Number, currency, and date formatting conventions differ by locale. A regex that splices in commas every three digits assumes English-style grouping, and a hardcoded currency symbol misses that Korean won (₩, no decimals) and US dollars ($, two decimal places) don't format the same way.
'Intl.NumberFormat(locale, options)' is the browser's built-in fix. Same number, same code — swap only the locale argument and the grouping separator, currency symbol, and decimal places all adjust to that country's convention automatically.
The demo puts hand-spliced commas (✕) next to real 'Intl.NumberFormat' output (✓), reformatting live every 3 seconds as the number changes. The ✓ side shows both the ko-KR and en-US results at once.
When to use
Default to Intl.NumberFormat instead of string manipulation any time you display an amount, a stat, or a large number.