Bloomberg invests in Node.js – Shouldn't you?(nearform.com) |
Bloomberg invests in Node.js – Shouldn't you?(nearform.com) |
Every time you want to display a price on the terminal, you really should spend time thinking about whether that price would be displayed correctly.
The particular rounding rules even vary from currency to currency. Some are even enforced by law, so bugs could leave you exposed to regulatory risks. And people tend to get touchy when you are dorking with their money.
What happened in practice was that everybody just ignored it--but sooner or later, some obscure but urgent bug would pop up. Inevitably, it was hard to trace and hard to fix, because there's no support there for the arithmetic which people actually use for money.
A native decimal type would be great.
https://github.com/tc39/proposal-decimal
This is an active proposal and was last discussed in the September 2023 meeting.