3 ms·
Nothing in the json spec requires that numbers are limited to those internally representable in a javascript runtime. With the right tooling, you can encode/de
by shuzchen 13y ago
Nothing in the json spec requires that numbers are limited to those internally representable in a javascript runtime. With the right tooling, you can encode/decode very accurate numeric values. I'm not familiar with the go libraries, but python's simplejson has a use_decimal flag that interprets floats using python's Decimal module.
That said, I can't think of any reason a web server needs super accurate numbers. All the config options I can think of require nice round ints. Maybe specifying weights to individual backends to proxy to (so all the weights sum up to 1.0)?
- harrytuttle 13y ago99% of sites are CRUD apps, but we're math heavy financial software. We store a lot of reference data in configuration for performance reasons. This needs to be decimal format. JSON is a subset of the ECMA JavaScript standard which declares only floating point. Do "100!" on wolfram alpha and find me a parser that will load that as an example.
- shuzchen 13y agoworks for me: https://gist.github.com/sirpengi/609711 https://gist.github.com/sirpengi/609711
- harrytuttle 13y agoI get a 404. ?
- shuzchen 13y agoBad copy pasta (missing 3 at the end): https://gist.github.com/sirpengi/6097113 https://gist.github.com/sirpengi/6097113