federomero / pretty-json

Atom plugin. Format JSON documents.
MIT License
94 stars 23 forks source link

It appears to do some math truncation with very large integer values #3

Closed davegriffin closed 8 years ago

davegriffin commented 10 years ago

For example:

{"foo":6926665213734576388}

get's prettified to:

{ "foo": 6926665213734576000 }

davegriffin commented 10 years ago

This is because the integer provided exceeds Javascript's 15-digit maximum assured precision. It might be worth throwing an error if it can't guarantee the integrity of pretty-printed values?

federomero commented 10 years ago

Yeah, it's definitely that. I googled around and found this: https://github.com/sidorares/json-bigint which might help but I didn't have a chance to try it yet.

lexicalunit commented 8 years ago

f8dfac2 fixes this issue, I will release a new version soon.