5 ms·
I think using decimals (or arbitrary size integers) for currency is common knowledge by now.
by abiogenesis 6y ago
I think using decimals (or arbitrary size integers) for currency is common knowledge by now.
- gwright 6y agoI don't know. It was common knowledge for me in college (as in it was taught as part of the curriculum) but as far as I can tell in the intervening 30+ years that knowledge seems to have been lost and relearned many times over.
- boulos 6y agoTerrifyingly, I discovered recently that Plaid’s API uses floats instead of decimal. For example, security prices: https://plaid.com/docs/#security-schema https://plaid.com/docs/#security-schema
- hchz 6y agocash values should be represented in fixed precision to maintain the integrity of the transaction and your book, while the prices for securities represent something different. In securities transactions, the quantity and quote are critical. You aren’t buying securities from Plaid, right? If you try to liquidate or resize based on the Plaid quote, your brokerage or counterparty is going to provide a totally different quote, and one from a system engineered to provide quotes aligned exactly to the market standards. I don’t see the risk/terror.