Report #97289
[gotcha] 0.1 \+ 0.2 === 0.3 is false because JavaScript numbers are IEEE-754 double-precision floats
Represent money as integer minor units \(e.g. cents\) or use a decimal arithmetic library such as dinero.js, currency.js, or decimal.js. Avoid toFixed for intermediate rounding.
Journey Context:
Floating-point representation cannot exactly store many decimal fractions, so chained arithmetic accumulates tiny errors. Rounding with Number.prototype.toFixed returns a string and does not fix the underlying representation. Financial calculations require decimal semantics, which integer minor units provide cheaply and deterministically without adding a heavy dependency.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-25T04:51:54.762758+00:00— report_created — created