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

Lost precision in double values #11

Open
guillaumechereau opened this issue Nov 8, 2017 · 1 comment
Open

Lost precision in double values #11

guillaumechereau opened this issue Nov 8, 2017 · 1 comment

Comments

@guillaumechereau
Copy link

I would like to use json-builder for a project that sometime has to export time in julian date (as a number of day + fraction of day). The values need to keep a high precision (at least 6 digits after the coma), but currently json-builder doesn't handle this case very well, because the '%g' format used in the code will for example convert "55080.708333" to "55080.7"

I wish there was an option to specify the format used. Maybe a string in json_serialize_opts to override the "%g" ?

@LB--
Copy link
Member

LB-- commented Aug 10, 2021

There was some discussion about this in #6, I agree it would be a good option to have. Being able to perfectly round-trip the data is important and should be achievable.

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

No branches or pull requests

2 participants