18
Views
4
Comments
[JSON Pretty Format] Support for large numbers (int64)
json-pretty-format
Web icon
Forge asset by Pedro Domingues
Application Type
Traditional Web

Thanks for this tool, is very useful.


Apparently this component does not work well with large long integer numbers. 

An example: using  JSON Pretty Format to format some json that has an entry with the number 9223372036854775807  we get 9223372036854776000 instead. 

This is a known handicap for JSON.parse.


Any workaround?

2026-03-23 09-58-51
Pedro Domingues
Champion

Hi Eduardo, how are you?

Can you please provide the example of the JSON that you are using?

Thanks a lot.

Cheers,

Pedro Domingues

UserImage.jpg
Eduardo Luís

Hi Pedro, thanks for your reply.

It's not the JSON i'm using but it serves the purpose:


{

    "glossary":{

        "title": "example glossary",

        "GlossDiv": {

            "title": "S",

            "GlossEntry": {

                "ID": 9223372036854775807,

                "link": "https://www.w3.org/MarkUp/SGML/",

                "Acronym": "SGML",

                "GlossDef": {

                    "GlossSeeAlso": ["GML", "XML"]

                }

            }

        }

    }

}


This example was taken from the component demo page.

One can see the diference between the original and the formatted json.

Here's a link regarding JSON.parse problem with large numbers.


Thanks 

Eduardo Luís

2026-03-23 09-58-51
Pedro Domingues
Champion

Hi Eduardo,

Sorry for the late reply. I just want to let you know that i will take a look into this limitation within the next couple of days.

I'll get back to you once it's done!

Cheers,

Pedro Domingues

2026-03-23 09-58-51
Pedro Domingues
Champion

Hi Eduardo, how are you?

First of all, i apologize for the time it took me to get back to you.

I investigated about this limitation and the support for bigNumbers is already available inside the jQuery library that we are using.

Unfortunately, in order to make this to work, a huge refactor needs to be done and, honestly, this is something that will require time that i don't have for now.

I hope you understand and, once again, i am sorry for this.

Happy easter!

Cheers,

Pedro Domingues

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.