Support combining numeric formats#397
Merged
Merged
Conversation
Comma-separated numeric formats compose as a pipeline (invert, precision3): the raw number threads through every segment and is locale-formatted once at the end. Explicit precision wins wherever it appears; otherwise the last segment's default applies. The editor's format dropdown gains a Custom… option with a free-text field, which also keeps YAML-only format strings from being clobbered by form edits. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Comma-separated numeric formats now compose as a pipeline:
format: invert, precision3,kilo, precision1,invert, kilo3. The raw number threads through every segment and is locale-formatted exactly once at the end. An explicitprecision<N>controls decimals wherever it appears; otherwise the last segment's own default applies; otherwise source decimals are preserved. Only number-transforming formats compose — durations/timestamps/text transforms fall through unchanged.The visual editor's Format dropdown gains a Custom… option revealing a free-text field, which also protects YAML-only format strings (pipelines,
precision7) from being clobbered when the row is edited through the form.Fixes #385.
Test plan
yarn build(lint + type-check + 186 tests + webpack) passes; 14 new tests