Number Formatting by Locale: Commas, Periods, and Space Separators
How different countries format numbers: 1,000.00 vs 1.000,00 vs 1 000,00. The Intl.NumberFormat API and locale-aware formatting for global apps.
Published:
Tags: text, developer-tools, i18n
Number Formatting by Locale: Commas, Periods, and Spaces The number looks the same on every computer screen, but when formatted for display it looks radically different depending on the locale. An American sees . A German sees . An Indian sees . A Swiss sees . Using the wrong format in the wrong locale is not just aesthetically wrong — it causes misreading of values by orders of magnitude. Locale Examples | Locale | Code | Example | |--------|------|---------| | United States | en-US | 1,234,567.89 | | Germany | de-DE | 1.234.567,89 | | France | fr-FR | 1 234 567,89 | | India | en-IN | 12,34,567.89 | | Switzerland | de-CH | 1 234 567.89 | | Brazil | pt-BR | 1.234.567,89 | | Japan | ja-JP | 1,234,567.89 | | Sweden | sv-SE | 1 234 567,89 | Note the Indian system — it uses three digits in…
All articles · theproductguy.in