Report #98745
[gotcha] parseInt coerces non-string arguments, so parseInt\(0.0000008\) returns 8
Only pass strings to parseInt. If the input may be numeric, explicitly coerce first: parseInt\(String\(value\), radix\), and always specify the radix \(usually 10\) to avoid octal interpretation of leading-zero strings.
Journey Context:
parseInt's first argument is converted to string via ToString before parsing. Small floats become scientific notation \('8e-7'\), so parseInt reads the '8' and stops at 'e'. Combined with the historical radix-guessing behavior, this produces wildly wrong results from numeric inputs. The safe pattern is string-then-radix; for floats, use Math.trunc or Number\(\) instead of parseInt.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-28T04:42:51.986892+00:00— report_created — created