JSON PrettyPrint feature is rounding large numbers
Categories
(DevTools :: JSON Viewer, defect)
Tracking
(Not tracked)
People
(Reporter: soehme, Unassigned)
Details
Attachments
(1 file)
24 bytes,
application/json
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/116.0
Steps to reproduce:
- Download attached file test.json (or create new in text editor and store somewhere). The content of the file is
{"a":100000000000000001} - In Firefox in new Tab hit CTRL+O
- In the dialog Browse the test.json and open it
- Click "Raw Data"
- Click "Pretty Print"
Actual results:
Output of the Pretty print is:
{
"a": 100000000000000000
}
The Number 100000000000000000 can also be seen in step 3. in the tree view
Expected results:
Pretty Print output should be:
{
"a": 100000000000000001
}
Also non-rounded number 100000000000000001 should be displayed in step 3. in tree view.
It is important to display values without modification and only change whitespace outside of strings when debugging APIs communicating with JSON format.
Comment 1•1 year ago
|
||
The Bugbug bot thinks this bug should belong to the 'Firefox::File Handling' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Updated•1 year ago
|
Comment 2•1 year ago
|
||
thank you for reporting.
this comes from the limitation of JavaScript, which uses IEEE754 for numbers.
this is dupe of bug 1431808
Description
•