7 #include "knowrob/storage/mongo/bson-helper.h"
11 auto iterType = bson_iter_type(iter);
12 if (iterType == BSON_TYPE_DECIMAL128) {
13 bson_decimal128_t decimal;
14 bson_iter_decimal128(iter, &decimal);
15 if (decimal.high == 0x7800000000000000 || decimal.high == 0xf800000000000000) {
19 char buffer[BSON_DECIMAL128_STRING];
20 bson_decimal128_to_string(&decimal, buffer);
21 setlocale(LC_NUMERIC,
"C");
22 auto val = atof(buffer);
23 setlocale(LC_NUMERIC,
"");
26 }
else if (iterType == BSON_TYPE_DOUBLE) {
27 return bson_iter_double(iter);
std::optional< double > bson_iterOptionalDouble(const bson_iter_t *iter)