4 ms·
If you want to use native JSON, store it as an object with a string. { "small": 2, "large": { "bignum": "-9223372036854775807.4237482374983253298159" } } Then
by Raphael 13y ago
If you want to use native JSON, store it as an object with a string.
{
"small": 2,
"large": { "bignum": "-9223372036854775807.4237482374983253298159" }
}
Then make sure to replace or treat the object as a big number. Granted, it is more busywork.
- rpedela 13y agoThat is fine if the JSON consumer and producer are Javascript. What happens when the producer is a language that handles large numbers correctly? The numbers are rounded in Javascript.