DOKK / manpages / debian 11 / libbson-doc / bson_decimal128_from_string.3.en
BSON_DECIMAL128_FROM_STRING(3) libbson BSON_DECIMAL128_FROM_STRING(3)

bson_decimal128_from_string - bson_decimal128_from_string()

bool
bson_decimal128_from_string (const char *string, bson_decimal128_t *dec);


  • string: A string containing ASCII encoded Decimal128.
  • 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 ("1.00", &dec);


MongoDB, Inc

2017-present, MongoDB, Inc

June 4, 2021 1.17.6