Report #4949
[gotcha] JSON.stringify silently loses precision on integers larger than 2^53
Represent monetary values or large IDs as strings in JSON, or use BigInt with a replacer/reviver that converts to string. Never transmit unbounded integers as JSON numbers.
Journey Context:
JSON numbers are IEEE 754 doubles, limiting safe integers to 2^53 - 1. JSON.stringify does not throw on larger values; it rounds to the nearest representable double. This corrupts database IDs \(Snowflake, etc.\) and financial calculations. BigInt throws on direct JSON.stringify, requiring explicit string conversion.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T20:20:46.781259+00:00— report_created — created