Provided by: libbson-doc_2.2.1-1_all 

SYNOPSIS
bool
bson_decimal128_from_string_w_len (const char *string,
int len,
bson_decimal128_t *dec);
PARAMETERS
• string: A string containing ASCII encoded Decimal128.
• len: The length of string in bytes, or -1 meaning the string is null-terminated.
• dec: A bson_decimal128_t <>.
DESCRIPTION
Parses the string containing ascii encoded Decimal128 and initialize the bytes in dec. See the Decimal128
specification <https://github.com/mongodb/specifications/blob/master/source/bson-decimal128/decimal128
.md> for the exact string format.
RETURNS
Returns true if valid Decimal128 string was provided, otherwise false and dec will be set to NaN.
EXAMPLE
bson_decimal128_t dec;
bson_decimal128_from_string_w_len ("1.00", 4, &dec);
bson_decimal128_from_string_w_len ("1.00", -1, &dec);
Author
MongoDB, Inc
Copyright
2009-present, MongoDB, Inc.
2.2.1 Dec 11, 2025 BSON_DECIMAL128_FROM_STRING_W_LEN(3)