Bloomberg invests in Node.js – Shouldn't you?
nearform.comWhen I was working at Bloomberg, one of the problems I faced is that JavaScript doesn't have a decimal numeric datatype. This is a drawback which even Douglas Crawford has pointed out.
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.
There are of course npm packages for this (or one could write a class), but this is circling back to the problem of maintaining consistency with multiple contributors.
A native decimal type would be great.
Bloomberg are currently sponsoring Igalia to work on adding native Decimal number support to JavaScript.
https://github.com/tc39/proposal-decimal
This is an active proposal and was last discussed in the September 2023 meeting.
Great News!! Like any big company, Bloomberg had its inertia, but it is way better than most. It has a surprisingly engineer-centric culture.