Closed paulschreiber closed 2 years ago
The Firefox version of JSONView 1.1.1 does not have this problem.
The data displayed in the browser is a JavaScript object, so it's converted to a Number.
There's no disagreement that the values are numbers. The problem is that a floating point "14.0" is being displayed as an integer "14".
The extension relies on JSON.parse
to parse the JSON string and convert it to a JavaScript object, that's why the value is an integer. JSON.parse("14.0")
returns 14
and that's the expected behavior.
That's definitely not what users are expecting the behaviour to be.
Then, they should use another extension maybe. The goal of this one is to display JSON strings as JavaScript objects.
Floating point numbers ending in .0 are incorrectly converted to integers:
Example: