Closed Bug 1847897 Opened 1 year ago Closed 1 year ago

JSON PrettyPrint feature is rounding large numbers

Categories

(DevTools :: JSON Viewer, defect)

Firefox 116
defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1431808

People

(Reporter: soehme, Unassigned)

Details

Attachments

(1 file)

24 bytes, application/json
Details
Attached file test.json

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/116.0

Steps to reproduce:

  1. Download attached file test.json (or create new in text editor and store somewhere). The content of the file is
    {"a":100000000000000001}
  2. In Firefox in new Tab hit CTRL+O
  3. In the dialog Browse the test.json and open it
  4. Click "Raw Data"
  5. 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.

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.

Component: Untriaged → File Handling
Component: File Handling → JSON Viewer
Product: Firefox → DevTools

thank you for reporting.
this comes from the limitation of JavaScript, which uses IEEE754 for numbers.
this is dupe of bug 1431808

Status: UNCONFIRMED → RESOLVED
Closed: 1 year ago
Duplicate of bug: 1431808
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: