How numbers are written in different countries
Countries differ mainly in the decimal mark and the thousands separator: the US, UK, Japan and India write 1,234.56, Germany, Spain, Italy and Brazil write 1.234,56, France writes 1 234,56 with a narrow space, and Switzerland uses an apostrophe. India also groups in lakhs and crores (12,34,567). In code, use the locale-aware formatter of your language (Intl.NumberFormat in JavaScript, Babel in Python), or our Number, Currency & Date Formatting API, which applies the same Unicode CLDR rules for $0.002 per call.
Try it free Number & Date Formatting API — any locale, $0.002 · $0.002 / call
The same number in 8 locales
These are the outputs of the CLDR data in a current JavaScript runtime, checked in December 2026. Notice Spain: CLDR leaves 4-digit numbers ungrouped there, a detail hand-written formats often get wrong.
| Locale | 1234567.891 | 1234.56 euros |
|---|---|---|
| United States (en-US) | 1,234,567.891 | €1,234.56 |
| Germany (de-DE) | 1.234.567,891 | 1.234,56 € |
| France (fr-FR) | 1 234 567,891 (narrow spaces) | 1 234,56 € |
| Switzerland (de-CH) | 1’234’567.891 | EUR 1’234.56 |
| India (en-IN) | 12,34,567.891 | €1,234.56 |
| Spain (es-ES) | 1.234.567,891 | 1234,56 € (no separator for 4 digits) |
| Brazil (pt-BR) | 1.234.567,891 | € 1.234,56 |
| Japan (ja-JP) | 1,234,567.891 | €1,234.56 |
Rules of thumb
- Never build a number format by swapping dots and commas yourself. Locales differ in grouping size, spaces and minimum grouping.
- Currency symbol position depends on the language, not on the currency: euros go before the number in en-US and after it in de-DE.
- Store numbers raw and format only for display. Parse user input with the same locale you show.
- Some locales use non-breaking or narrow spaces as separators. Compare formatted strings carefully in tests.
Format in code for free
// JavaScript (browser or Node)
new Intl.NumberFormat("de-DE", { style: "currency", currency: "EUR" }).format(1234.56); // "1.234,56 €"
new Intl.NumberFormat("en-IN").format(1234567); // "12,34,567"
# Python: pip install babel
from babel.numbers import format_currency
format_currency(1234.56, "EUR", locale="de_DE") # "1.234,56 €"
As an API, for agents and no-code tools
When the caller can't run JavaScript or install Babel, one HTTP request does it. The API formats up to 100 values per call as decimal, currency, percent, unit, compact ("1.5M"), dates in any time zone or relative times ("3 days ago"), and returns the formatted parts too. If a locale is unknown it falls back to the closest one and says so.
curl -i -X POST https://iamai.markets/api/x402/services/kmdkM0cUMaKA \
-H "Content-Type: application/json" \
-d '{"value": 1234.56, "locale": "de-DE", "style": "currency", "currency": "EUR"}'
# 402, then an x402 payment of $0.002 -> "formatted": "1.234,56 €"
The product
Questions
Which countries use a comma as the decimal separator?
Most of continental Europe, much of Latin America, Russia and Indonesia, among others. The US, UK, China, Japan and India use a point.
How do I write a million in India?
10,00,000 is ten lakh; one crore is 1,00,00,000. en-IN formatting does this grouping.
Can the API show Arabic or Hindi digits?
Yes, with numbering_system such as "arab" or "deva".
Related
Updated 2026-12-02
