5 ms·
Or you could use fixed point math: 600 in database means $6.00 Then aggregates and comparison operators would work, but you would have to decide upfront how muc
by cuu508 14y ago
Or you could use fixed point math: 600 in database means $6.00
Then aggregates and comparison operators would work, but you would have to decide upfront how much precision you might ever need
- erichocean 14y agoThat sounds good, but with only 53 bits of integer precision in JSON (51 if you move the decimal point to account for cents), there's just not enough digits for finance these days. A similar problem exists if you use JSON numbers (aka doubles) for timestamps –- the numbers just aren't big enough to do it accurately.
- ksec 14y agoInteresting, that is something i not think about much, any solution to that?
- moe 14y agoExcuse me, what financial application rounds to 51 digits?
- leif 14y agoAnd doesn't moving the decimal point chop off between 6 and 7 bits?
- haberman 14y agoJSON is not by definition limited to 53 bits of precision -- the standard itself does not specify range or precision. In practice, most implementations represent a JSON number with a double though.
- shrughes 14y agoMaybe one that wants to keep working through high inflation scenarios. (But what financial software is running on a NoSQL database?)