Hacker News new | ask | show | jobs
by carnitine 1749 days ago
JS is already very popular in finance, decimal types aren’t always needed for monetary values, floats are often fine (or computations can be done on the backend).
2 comments

We usually store the values as longs and apply the decimal marker only when showing to the user. Floats are fine when it's just long to float. But any operation between two floats is a mistake.
Not for financial modelling which is the bulk of work in the front office. Everything is calculated as floats for performance reasons, no model is accurate enough for floating point error to matter.
> or computations can be done on the backend

what if your backend is nodejs? decimals for JS are mainly needed on backend