fix: localize decimal separator - #2889
Open
xhon-pelushi wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the number-cell renderer in the Tables Vue frontend to format decimal values using the user’s current locale (e.g., comma as decimal separator in de_DE), addressing Issue #1570’s incorrect separator display.
Changes:
- Switch number display formatting from
toFixed()to locale-awareIntl.NumberFormatusing the Nextcloud locale. - Add Cypress component coverage to verify locale-specific decimal separators and fixed decimal precision.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/shared/components/ncTable/partials/TableCellNumber.vue | Formats displayed numeric values using a locale-aware formatter instead of a hardcoded . decimal separator. |
| cypress/component/TableCellNumber.cy.js | Adds component tests validating localized decimal separator output and preserved decimal precision. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+46
to
+51
| const fractionDigits = Number(this.column?.numberDecimals ?? 0) | ||
| return new Intl.NumberFormat(getCanonicalLocale(), { | ||
| maximumFractionDigits: fractionDigits, | ||
| minimumFractionDigits: fractionDigits, | ||
| useGrouping: false, | ||
| }).format(this.value) |
Author
There was a problem hiding this comment.
Good catch — clamped numberDecimals to the 0..20 integer range Intl.NumberFormat accepts (via Math.trunc + min/max) so out-of-range values no longer throw RangeError when rendering. Added a Cypress case for an oversized decimal count.
Fixes nextcloud#1570 Clamp fraction digits to the 0..20 range accepted by Intl.NumberFormat so out-of-range column settings cannot throw RangeError while rendering. Signed-off-by: xhon-pelushi <xhon@pelushi.com>
xhon-pelushi
force-pushed
the
fix/tables-1570-localized-decimals
branch
from
August 14, 2026 03:49
6d33a0c to
aec7e1f
Compare
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.
Use locale-aware decimal separators.
Fixes #1570
Test plan