DOKK / manpages / debian 10 / libbson-doc / bson_decimal128_from_string_w_len.3.en
BSON_DECIMAL128_FROM_STRING_W_LEN(3) Libbson BSON_DECIMAL128_FROM_STRING_W_LEN(3)

bson_decimal128_from_string_w_len - bson_decimal128_from_string_w_len()

bool
bson_decimal128_from_string_w_len (const char *string,

int len,
bson_decimal128_t *dec);


  • 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.

Parses the string containing ascii encoded Decimal128 and initialize the bytes in dec. See the Decimal128 specification for the exact string format.

Returns true if valid Decimal128 string was provided, otherwise false and dec will be set to NaN.

bson_decimal128_t dec;
bson_decimal128_from_string_w_len ("1.00", 4, &dec);
bson_decimal128_from_string_w_len ("1.00", -1, &dec);


MongoDB, Inc

2017-present, MongoDB, Inc

February 23, 2019 1.14.0