[GH-ISSUE #2166] [bug]: Large numbers are wrong/rounded in JSON response view #733

Closed
opened 2026-03-16 16:55:03 +03:00 by kerem · 1 comment
Owner

Originally created by @arm32x on GitHub (Mar 15, 2022).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/2166

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

When JSON data containing large numbers is shown in the JSON response view, the numbers are incorrect (rounded).

JSON sent by server:

{"an_integer":555555555555555555,"a_float":555555555555555555.555}

Shown in JSON view in Hoppscotch:

{
  "an_integer": 555555555555555600,
  "a_float": 555555555555555600
}

What is expected to be shown:

{
  "an_integer": 555555555555555555,
  "a_float": 555555555555555555.555
}

Steps to reproduce

  1. Create a JSON file with the following content:
    {"an_integer":555555555555555555,"a_float":555555555555555555.555}
    
  2. Run a static HTTP server (your choice)
  3. Send a GET request to fetch your JSON file
  4. Open the JSON response view and see incorrect numbers

Environment

Production

Version

Cloud

Originally created by @arm32x on GitHub (Mar 15, 2022). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/2166 ### Is there an existing issue for this? - [X] I have searched the existing issues ### Current behavior When JSON data containing large numbers is shown in the JSON response view, the numbers are incorrect (rounded). JSON sent by server: ```json {"an_integer":555555555555555555,"a_float":555555555555555555.555} ``` Shown in JSON view in Hoppscotch: ```json { "an_integer": 555555555555555600, "a_float": 555555555555555600 } ``` What is expected to be shown: ```json { "an_integer": 555555555555555555, "a_float": 555555555555555555.555 } ``` ### Steps to reproduce 1. Create a JSON file with the following content: ```json {"an_integer":555555555555555555,"a_float":555555555555555555.555} ``` 2. Run a static HTTP server (your choice) 3. Send a GET request to fetch your JSON file 4. Open the JSON response view and see incorrect numbers ### Environment Production ### Version Cloud
kerem 2026-03-16 16:55:03 +03:00
Author
Owner

@liyasthomas commented on GitHub (Mar 15, 2022):

Seems like JavaScript is rounding off large numbers in JSON.parse() and JSON.stringify() operations. Guess it'd be better to use any libs like lossless-json on responses.

cc: @AndrewBastin

<!-- gh-comment-id:1067545025 --> @liyasthomas commented on GitHub (Mar 15, 2022): Seems like JavaScript is rounding off large numbers in `JSON.parse()` and `JSON.stringify()` operations. Guess it'd be better to use any libs like [lossless-json](https://github.com/josdejong/lossless-json) on responses. cc: @AndrewBastin
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#733
No description provided.