miller/pkg/mlrval
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
..
dispositions_test.go Add a first-class bytes type to the DSL, with b"..." literals and base64/hex codecs (#2122) 2026-07-03 11:58:44 -04:00
mlrmap.go Lazy per-record hashing: ~15-30% faster on common workloads (#2081) 2026-06-19 16:37:42 -04:00
mlrmap_accessors.go Lint round 5+6: staticcheck and errcheck to zero (#2130) 2026-07-03 11:42:08 -04:00
mlrmap_accessors_test.go Implement mlr uniq -x (#1457) 2023-12-23 16:20:11 -05:00
mlrmap_flatten_unflatten.go Lint round 5+6: staticcheck and errcheck to zero (#2130) 2026-07-03 11:42:08 -04:00
mlrmap_json.go Fix govet lint findings; fix masked unset-on-array error path (#2129) 2026-07-03 10:31:08 -04:00
mlrmap_new_test.go Export library code in pkg/ (#1391) 2023-09-10 17:15:13 -04:00
mlrmap_print.go Fix govet lint findings; fix masked unset-on-array error path (#2129) 2026-07-03 10:31:08 -04:00
mlrval_accessors.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
mlrval_benchmark_test.go The package version must match the major tag version (#1654) 2024-09-20 12:10:11 -04:00
mlrval_bytes_test.go Add a first-class bytes type to the DSL, with b"..." literals and base64/hex codecs (#2122) 2026-07-03 11:58:44 -04:00
mlrval_cmp.go Add a first-class bytes type to the DSL, with b"..." literals and base64/hex codecs (#2122) 2026-07-03 11:58:44 -04:00
mlrval_cmp_test.go Strip dead code from pkg/ (#2121) 2026-07-01 19:32:13 -04:00
mlrval_collections.go Fix govet lint findings; fix masked unset-on-array error path (#2129) 2026-07-03 10:31:08 -04:00
mlrval_collections_test.go Fix govet lint findings; fix masked unset-on-array error path (#2129) 2026-07-03 10:31:08 -04:00
mlrval_constants.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
mlrval_copy.go Add a first-class bytes type to the DSL, with b"..." literals and base64/hex codecs (#2122) 2026-07-03 11:58:44 -04:00
mlrval_format.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
mlrval_format_test.go Export library code in pkg/ (#1391) 2023-09-10 17:15:13 -04:00
mlrval_get.go Add a first-class bytes type to the DSL, with b"..." literals and base64/hex codecs (#2122) 2026-07-03 11:58:44 -04:00
mlrval_get_test.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
mlrval_infer.go Strip dead code from pkg/ (#2121) 2026-07-01 19:32:13 -04:00
mlrval_infer_test.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
mlrval_is.go Add a first-class bytes type to the DSL, with b"..." literals and base64/hex codecs (#2122) 2026-07-03 11:58:44 -04:00
mlrval_is_test.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
mlrval_json.go Emit valid JSON numbers for floats like 004.56; document CSV quoting vs. type inference (#2151) 2026-07-05 20:19:32 -04:00
mlrval_json_test.go Emit valid JSON numbers for floats like 004.56; document CSV quoting vs. type inference (#2151) 2026-07-05 20:19:32 -04:00
mlrval_new.go Add a first-class bytes type to the DSL, with b"..." literals and base64/hex codecs (#2122) 2026-07-03 11:58:44 -04:00
mlrval_new_test.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
mlrval_output.go Add a first-class bytes type to the DSL, with b"..." literals and base64/hex codecs (#2122) 2026-07-03 11:58:44 -04:00
mlrval_output_test.go Export library code in pkg/ (#1391) 2023-09-10 17:15:13 -04:00
mlrval_sort.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
mlrval_sort_test.go Multiple style updates (#1974) 2026-02-16 15:49:21 -05:00
mlrval_type.go Add a first-class bytes type to the DSL, with b"..." literals and base64/hex codecs (#2122) 2026-07-03 11:58:44 -04:00
mlrval_type_test.go Export library code in pkg/ (#1391) 2023-09-10 17:15:13 -04:00
mlrval_yaml.go Add a first-class bytes type to the DSL, with b"..." literals and base64/hex codecs (#2122) 2026-07-03 11:58:44 -04:00
mlrval_yaml_test.go fix: preserve key order in YAML output (#2034) 2026-04-12 09:43:09 -04:00
record_arena.go Batch-allocate per-record objects; reuse CSV writer field buffer (#2083) 2026-06-19 17:03:04 -04:00