alek-sys / sublimetext_indentxml

Plugin for Sublime Text editor for reindenting XML and JSON files
MIT License
534 stars 136 forks source link

format json with decimal number is wrong #100

Open ghost opened 7 years ago

ghost commented 7 years ago

Format json with decimal number is wrong. Version: v2017.03.23.23.32.07

Example, source json:

{"balance": 10000.0, "interestRate": 39.99, "payments": [], "status": "approved"}

format json:

{ "balance": 10000.0, "interestRate": 39.990000000000002, "payments": [], "status": "approved" }

Field value "interestRate" content extra simbols.

Leyline77 commented 6 years ago

I too see this issue. it is converting numbers to float, I think it should treat them as strings, but leave quotes off on output.

Source: { "Amount": 9365.10, "key2": "ok"}

Formatted: { "Amount": 9365.1000000000004, "key2": "ok" }