Report #97787
[gotcha] 0.1 \+ 0.2 \!== 0.3 breaks monetary calculations
Store and calculate money as integer minor units \(cents\) or use a decimal library such as decimal.js or dinero.js; never use raw Number for financial arithmetic.
Journey Context:
IEEE 754 double-precision floats cannot exactly represent many decimal fractions. Rounding with toFixed only at display time is insufficient because intermediate sums accumulate error. Integer math is exact and fast; decimal libraries handle currency rounding rules when you cannot store minor units.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-26T04:42:01.596825+00:00— report_created — created