WORKED EXAMPLE · SYNTHETIC INPUT
Keep a large order ID intact when processing JSON
An identifier exceeds JavaScript’s safe integer range. Parsing it as a Number can change its digits before you notice.
阅读中文版
These inputs demonstrate reproducible behaviour; they are not customer incidents or evidence of real usage.
Reproducible input
{"orderId":9007199254740993,"paid":false}Steps
- Load the numeric sample and format it. Inspect the precision warning.
- Compare every digit: the formatter preserves 9007199254740993 as written.
- If the API contract defines this value as an identifier, change the producing service to emit a quoted string and repeat the conversion.
Expected result
The original numeric token stays intact, but downstream YAML conversion and type inference reject its precision risk. The quoted string version can be converted without rounding.
Limits and manual checks
Quoting is a contract decision, not an automatic repair. If downstream systems require a number, use an agreed arbitrary-precision implementation. The tool does not provide arbitrary-precision arithmetic.
Technical reference