0.0.3 • Published 9 years ago

stringnumber v0.0.3

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

StringNumber

JSON.parse/stringify that converts big numbers into strings. Based on json-bigint.

While most JSON parsers assume numeric values have same precision restrictions as IEEE 754 double, JSON specification does not say anything about number precision. Any floating point number in decimal (optionally scientific) notation is valid JSON value. It's a good idea to serialize values which might fall out of IEEE 754 integer precision as strings in your JSON api, but { "value" : 9223372036854775807}, for example, is still a valid RFC4627 JSON string, and in most JS runtimes the result of JSON.parse is this object: { value: 9223372036854776000 }