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

Serialization of double with no fractional component drops trailing zero #278

Closed
SteVwonder opened this issue Oct 25, 2016 · 1 comment · Fixed by #289
Closed

Serialization of double with no fractional component drops trailing zero #278

SteVwonder opened this issue Oct 25, 2016 · 1 comment · Fixed by #289

Comments

@SteVwonder
Copy link

Calling double-to-json_string on a double with no fractional component results in the dropping of both the trailing zero and the period (e.g. 1.0 is serialized as 1). So when that string is deserialized, the type is inferred as an int. I am not sure if this is the intended behavior of this function or not. This comment leads me to believe it is not. It seems that the use of %g is the cause of this behavior.

FWIW, you can find the full discussion we had about this issue in the flux-framework project here.

@hawicz
Copy link
Member

hawicz commented Oct 29, 2016

Yeah, that sounds like a bug to me.

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