Repository navigation
fix(results): format the summary numbers for the user's locale - #3972
Merged
Merged
Conversation
The results summary printed its counts, percentages, Borda scores and averages as raw JavaScript numbers: toFixed(1) for the average rank and grid averages, and a literal "%" after the percentages. They always used Latin digits, a decimal point and the English percent placement, whatever the user's language. Format them with Intl.NumberFormat for the user's locale instead, keeping one decimal for the averages and whole percentages. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
AndyScherzinger
force-pushed
the
fix/results-number-format
branch
from
November 21, 2026 10:59
c8f914b to
39f4172
Compare
Chartman123
approved these changes
Nov 21, 2026
Collaborator
|
/backport to stable5.4 |
Chartman123
enabled auto-merge
November 21, 2026 11:09
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.
The results summary printed its numbers as raw JavaScript numbers: the answer counts and percentages of the bars, the Borda scores and average rank of ranking questions, the counts, percentages and averages of grids, and the "No response" line of text answers. They always used Latin digits, a decimal point and a "%" glued to the number, whatever the user's language. A German user saw "2.3" and "50%" instead of "2,3" and "50 %", a Persian user Latin instead of Persian digits.
All of them are now formatted with
Intl.NumberFormatfor the user's locale (getCanonicalLocale()): counts as whole numbers with the locale's grouping, percentages with the locale's percent style, averages with one decimal. English output is unchanged except that counts of 1,000 and more get a thousands separator.Found in the review of #3635, which formats its new scale figures the same way.
How to verify
Open the results summary of a form with a multiple choice, a ranking, a radio grid, a number grid and a short answer question that have answers. Set your language to German: the bars read "1 (25 %)", the average rank "2,5", grid averages "3,0". Set it to Persian (فارسی): all of them use Persian digits. In English the output is as before.
Checked: ESLint, Prettier, stylelint and the build pass,
vue-tscreports no new errors (107, same asmain), and the formatters give1,234 / 50%,1.234 / 50 %,۱٬۲۳۴ / ۵۰٪for en-US / de-DE / fa-IR. Not yet checked on a live instance.🤖 AI (if applicable)