Lovelyxredxpanda / json-simple

Automatically exported from code.google.com/p/json-simple
Apache License 2.0
0 stars 0 forks source link

Patch: use BigDecimal for numbers instead of Double #73

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. put really large decimal number with also small parts in json input
2. parse
3. encode
4. detail is lost and/or formatting changes to scientific notation (which is 
not exactly a defect)

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

I'd like the numberical value to be preserved, with precision information if 
possible 

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

1.1.1 java6 and 7

Please provide any additional information below.

Patch is simple as one only need to replace Double handling with
yylex.java:608
{ BigDecimal val=new BigDecimal(yytext()); return new 
Yytoken(Yytoken.TYPE_VALUE, val);

Original issue reported on code.google.com by tuomas.l...@gmail.com on 2 Jun 2012 at 11:02

GoogleCodeExporter commented 9 years ago

Original comment by fangyid...@gmail.com on 4 Jul 2012 at 5:49

GoogleCodeExporter commented 9 years ago

Original comment by fangyid...@gmail.com on 4 Jul 2012 at 5:50

GoogleCodeExporter commented 9 years ago
Issue 57 has been merged into this issue.

Original comment by jon.cham...@gmail.com on 10 Aug 2013 at 5:01