Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is scientific notation number supported? #390

Closed
Huweicai opened this issue Nov 2, 2023 · 1 comment · Fixed by #415
Closed

Is scientific notation number supported? #390

Huweicai opened this issue Nov 2, 2023 · 1 comment · Fixed by #415

Comments

@Huweicai
Copy link

Huweicai commented Nov 2, 2023

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 Huweicai changed the title Is scientific notation supported? Is scientific notation number supported? Nov 2, 2023
@biojppm
Copy link
Owner

biojppm commented Mar 28, 2024

Sorry for the late reply. This is indeed a problem with the way the json emitter detects a number, thanks for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants