BSON_DECIMAL128_TO_STRING(3)

πŸ’… BSON_DECIMAL128_TO_STRING(3) πŸ’…

okay bestie, so this is a page from the libbson manual β€” yes, that libbson β€” and it's about turning a decimal128 into a string. glass of water, deep breath, let's go 🫢


✨ SYNOPSIS ✨

void
bson_decimal128_to_string (const bson_decimal128_t *dec, char *str);

like, that's the whole vibe. no return value, just vibes and a string. periodt πŸ’…


πŸŽ€ PARAMETERS πŸŽ€

  • dec β€” a bson_decimal128_t. that's the decimal128 you're converting, the main character of this whole operation ✨
  • str β€” a spot in memory of length BSON_DECIMAL128_STRING where the resulting string goes. that's right, the length is literally BSON_DECIMAL128_STRING, do not freestyle it, she needs her room πŸŽ€

πŸ¦‹ DESCRIPTION πŸ¦‹

converts dec into a printable string. that's it, that's the tweet. it's giving "simple, effective, iconic" πŸ”₯


🌸 EXAMPLE 🌸

ok so imagine you got your buffer and your decimal and you're ready to serve looks:

char decimal128_string[BSON_DECIMAL128_STRING];
bson_decimal128_to_string (&decimal128t, decimal128_string);

two lines. ate and left no crumbs πŸ’€βœ¨


πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc β€” the icon, the legend, the blueprint 🌈


2009-present, MongoDB, Inc. β€” respectfully, they've been at this since 2009, that's longevity fr fr 🫢


ngl bestie, this one's a short read. use the right buffer length (BSON_DECIMAL128_STRING) and you're golden πŸ’…

okay that's the whole page, mwah πŸ’‹ this was libbson version 2.5.6, dated Oct 09, 2026 β€” write it down bestie, iykyk β­πŸ§šπŸ’œ

πŸ“¦ where this page comes from