rapidyaml icon indicating copy to clipboard operation
rapidyaml copied to clipboard

Is scientific notation number supported?

Open Huweicai opened this issue 1 year ago • 0 comments

It seems that the number in scientific notation will be recognized as string now:

int main() {
    const std::string yml_buf = R"(quntity: 9.5e7
quntity2: 95000000)";
    ryml::Tree tree = ryml::parse_in_arena(c4::to_csubstr(yml_buf));
    std::string str_result = ryml::emitrs_json<std::string>(tree);
    std::cout << str_result;
}

Output: {"quntity": "9.5e7","quntity2": 95000000}

Huweicai avatar Nov 02 '23 03:11 Huweicai