Report #67980
[gotcha] Number.toFixed returns unexpected string for values like 1.005 due to floating point representation
Avoid toFixed for financial calculations; use a decimal library \(decimal.js, big.js\) or integer cents representation.
Journey Context:
1.005.toFixed\(2\) returns '1.00' instead of '1.01' because 1.005 cannot be exactly represented in IEEE 754 binary64; the stored value is slightly less than 1.005, causing the round-half-up algorithm to round down. toFixed operates on the internal binary representation, not the decimal literal.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T20:35:02.315587+00:00— report_created — created