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

Numbers are converted to doubles #504

Closed
GoogleCodeExporter opened this issue Mar 19, 2015 · 3 comments
Closed

Numbers are converted to doubles #504

GoogleCodeExporter opened this issue Mar 19, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
        Map x = new GsonBuilder().create().fromJson("{\"hello\":1}",Map.class);
        Assert.assertEquals(1,x.get("hello"));

What is the expected output? What do you see instead?

1 should be the value, but the value is read as 1.0.

What version of the product are you using? On what operating system?

2.2.2

Please provide any additional information below.

Original issue reported on code.google.com by mar...@jitisoft.com on 21 Feb 2013 at 2:48

@GoogleCodeExporter
Copy link
Author

Saw this post. Not sure if this is not going to be fixed for "performance 
reasons".

https://groups.google.com/forum/?fromgroups=#!topic/google-gson/SYRDR6JHBkc

Original comment by mar...@jitisoft.com on 21 Feb 2013 at 3:39

@GoogleCodeExporter
Copy link
Author

it would be nice to have an options that let the user decide (performance vs. 
accurateness upon unmarshalling

Original comment by ma...@edistream.com on 25 Apr 2013 at 11:50

@eamonnmcmanus
Copy link
Member

Fixed by #1290.

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