Skip to content

fix: handle numbers above 6 digits in formatMoney (#7956)#7969

Merged
alexander-akait merged 1 commit into
webpack:mainfrom
shivxmsharma:fix/format-money-large-numbers
Mar 10, 2026
Merged

fix: handle numbers above 6 digits in formatMoney (#7956)#7969
alexander-akait merged 1 commit into
webpack:mainfrom
shivxmsharma:fix/format-money-large-numbers

Conversation

@shivxmsharma

Copy link
Copy Markdown
Contributor

Summary

Fixes the formatMoney helper in Support.jsx which only inserted a single comma, incorrectly formatting numbers above 6 digits (e.g. 12345671234,567 instead of 1,234,567).

Replaced the manual string slicing with Number.toLocaleString('en-US') which correctly handles thousands separators for any number length.

Closes #7956

What kind of change does this PR introduce?

fix

Did you add tests for your changes?

No — this is a one-line utility fix. The function behavior can be verified visually on the Support/Sponsors page.

Does this PR introduce a breaking change?

No.

If relevant, what needs to be documented once your changes are merged or what have you already documented?

No documentation changes needed.

Use of AI

AI (Gemini CLI) was used to navigate the codebase and identify the bug location. The fix was determined through code analysis. I follow webpack's AI Policy.

@vercel

vercel Bot commented Mar 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
webpack-js-org Ready Ready Preview, Comment Mar 10, 2026 6:21am

Request Review

@alexander-akait alexander-akait merged commit 4a18ff2 into webpack:main Mar 10, 2026
9 checks passed
@shivxmsharma shivxmsharma deleted the fix/format-money-large-numbers branch March 10, 2026 15:18
pranjalisr pushed a commit to pranjalisr/webpack.js.org that referenced this pull request Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

formatMoney incorrectly formats numbers above 6 digits

2 participants