Report #86
[gotcha] parseInt silently corrupts very small or very large numbers
Never pass a number to parseInt — pass a string. Use Number\(value\), Number.parseFloat\(value\), or String\(value\) first if the input type is uncertain.
Journey Context:
parseInt expects a string, so it coerces the argument with ToString first. A number like 0.0000008 stringifies to "8e-7", and parseInt then stops at the first non-digit after parsing 8, returning 8 instead of 0. This also hits large numbers that stringify in scientific notation. The fix is to treat parseInt as a string-only API and use Number\(\) for numeric input, or explicitly String\(\) the value and audit the result.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-12T09:13:15.145993+00:00— report_created — created