columns.tsx LocaleNumber to use maximumFractionalDigits #7263
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.
Default formatting for number data-table columns updated to use calculated maxFractionalDigits based on locale.
📝 Summary
By default, a data-table uses
Intl.NumberFormatwith no options to display number types that have no explicit format. This can lead to rounding-when-displayed by default, which is antithetical to the expected behavior when displaying raw data (e.g. without explicit formatting).🔍 Description of Changes
Used the existing
maxFractionalDigitsfunction from the number utils to invoke theuseNumberFormatterfunction with a value for themaximumSignificantDigitsparameter.📋 Checklist
Note
Make data-table number rendering locale-aware with max fractional digits and add comprehensive LocaleNumber tests; minor test cleanups.
LocaleNumber: Exported and updated infrontend/src/components/data-table/columns.tsxto useuseLocaleandmaxFractionalDigits(locale)viauseNumberFormatter({ maximumFractionDigits }).__tests__/columns.test.tsxforLocaleNumberacross locales (en-US,de-DE,fr-FR,ja-JP) and edge cases (integers, zeros, negatives, large/small numbers, Infinity, -Infinity, NaN, scientific notation).frontend/src/core/cells/__tests__/logs.test.tsto use numeric separators; no behavior changes.frontend/src/plugins/layout/__test__/ProgressPlugin.test.tsforCasestuple typing.Written by Cursor Bugbot for commit 69f8f7d. This will update automatically on new commits. Configure here.