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

Floats/Doubles are outputted as Integers #8

Closed
bluesliverx opened this issue Nov 6, 2012 · 4 comments
Closed

Floats/Doubles are outputted as Integers #8

bluesliverx opened this issue Nov 6, 2012 · 4 comments

Comments

@bluesliverx
Copy link

Can you make a configuration option at least to output double/float values with the trailing zeros intact? It looks like doubles are trimmed from 1.0 to 1, removing the trailing period and zeros. I would like to keep this intact for our API.

@aalmiray
Copy link
Collaborator

Numbers are automatically downsized to their smallest representation if possible, this is why 1.0 (double) gets converted into 1 (double) but Double.MAX_VALUE stays as a double. We can certainly add a configuration flag to JsonConfig to skip the downsizing.

@bluesliverx
Copy link
Author

I think it would be very useful.

mischak pushed a commit to mischak/Json-lib that referenced this issue Aug 21, 2014
aalmiray added a commit that referenced this issue Aug 22, 2014
@aalmiray
Copy link
Collaborator

Fixed with #21

@aalmiray
Copy link
Collaborator

To be clear, there's no need for a configuration option as Json-lib was wrong in deleting trailing .0 from a floating point number.

aalmiray added a commit that referenced this issue Aug 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants