BSON_DECIMAL128_FROM_STRING(3)
β¨ BSON_DECIMAL128_FROM_STRING(3) β¨
okay so bestie, welcome to the libbson manual page for BSON_DECIMAL128_FROM_STRING(3) π this one is literally about turning a string into a Decimal128, and itβs giving parser main-character energy fr fr.
β¨ SYNOPSIS β¨
bool
bson_decimal128_from_string (const char *string, bson_decimal128_t *dec);
πΈ PARAMETERS πΈ
stringβ a string containing ASCII encoded Decimal128, bestie. Thatβs the input vibe.decβ abson_decimal128_t. This is the little container that gets the parsed result.
π¦ DESCRIPTION π¦
So this function parses the string containing ascii encoded Decimal128 and initializes the bytes in dec πβ¨. For the exact string format, check the Decimal128 specification β thatβs the authority, no cap.
π RETURNS π
It returns true if a valid Decimal128 string was provided. Otherwise it returns false, and dec will be set to NaN π.
iykyk: invalid string meansfalseplusdecbecomesNaN. Thatβs the whole vibe check.
π EXAMPLE π
not me being obsessed with this tiny example:
bson_decimal128_t dec;
bson_decimal128_from_string ("1.00", &dec);
π AUTHOR π
MongoDB, Inc
π COPYRIGHT π
2009-present, MongoDB, Inc.
mwah π β this iconic little page comes from libbson version 2.5.6, dated Oct 09, 2026. bye bestie, slay your Decimal128s π«Άπ
π¦ where this page comes from
- epel 10: libbson-devel 2.5.6-1.el10_3 Β· Apache-2.0 AND ISC AND MIT AND Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms