alek-sys / sublimetext_indentxml

Plugin for Sublime Text editor for reindenting XML and JSON files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

format json with decimal number is wrong

opened this issue · comments

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.

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"
}