miller/test/cases/io-json-io/0040/experr
John Kerl f8b6de7c23
Emit valid JSON numbers for floats like 004.56; document CSV quoting vs. type inference (#2151)
Miller type-inference accepts float formats which the JSON grammar
disallows -- leading zeros like 004.56, leading plus signs, bare leading
or trailing decimal points like .56 or 4., etc. -- and the JSON writer
passed the original text through verbatim, producing invalid JSON.
Leading-zero integers such as 0123456789 were already handled (inferred
as strings), and hex/binary/octal ints were already re-rendered as
decimal for JSON per #1761; this does the same for floats: when a
float string representation is not a valid JSON number, re-render it
(e.g. 004.56 -> 4.56).

Also documents in reference-main-data-types that CSV double-quoting
does not affect type inference, with -S / --infer-none and string()
as the ways to keep such values as strings.

Addresses #1114 and #1293.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-05 20:19:32 -04:00

0 lines
Text