Numbers are formatted using patterns, like "#,###.00". For example, the pattern "#,###.00" when used to format the number 12345.678 could result in "12'345,67". That would happen if the grouping separator for your language is an apostrophe, and the decimal separator is a comma.
Important: The characters . , 0 # (and others below) are special placeholders; they stand for the decimal separator, and so on, and are NOT real characters. You must NOT "translate" the placeholders; for example, don't change '.' to ',' even though in your language the decimal point is written with a comma.
Here are the special characters used in number patterns.
Whenever any of these symbols are in the English pattern, they must be retained in the pattern for your language. The positions of some of them (%, ¤) may be changed, or spaces added or removed. The symbols will be replaced by the local equivalents, using the Number Symbols for your language.
||Replaced automatically by the character used for the decimal point in your language. Not a real period; must be retained!
||Replaced by the "grouping" (thousands) separator in your language. Not a real comma; must be retained!
||Replaced by a digit (or zero if there aren't enough digits).
||Replaced by a digit (or nothing if there aren't enough). Often used to show the position of the ",".
||This will be replaced by a currency symbol, such as $ or USD. Note: by default a space is automatically added between letters in a currency symbol and adjacent numbers. So you don't need to add a space between them if your language writes "$12" but "USD 12".
||This marks a percent format. The % symbol may change position, but must be retained.
||This marks a scientific format. The E symbol may change position, but must be retained.
||If any of the above characters are used as literal characters, they must be quoted with ASCII single quotes. For example, in the Short Numbers if a period needs to be used to mark an abbreviation, it would appear as:
||If your language uses different formats for negative numbers than just adding "-" at the front, you can put in two patterns, separated by a semicolon. The first will be used for zero and positive values, while the second will be used for negative values.
- For example: #,##0.00¤;(#,##0.00¤) is used to make negative currencies appear like "(1'234,56£)" instead of "-1'234,56£". That is used for formatting currency amounts in English, but not for general-purpose decimal numbers.
Translators should not change the pattern of zeros (0) or hash marks (#) after a decimal point; those will be reset by software. This is true also for currency formats. Even if your currency doesn't use any decimal points, the currency format will have them in the pattern.
You need to modify the patterns when:
- The grouping separator is not by thousands (eg Hindi).
- The negative pattern doesn't simply add a minus sign. For example, if a negative number is formed by adding parentheses, then this would look like: #,##0.###;(#,##0.###). That is, the negative form gets added after a semicolon.
- The currency symbol (¤) or percent sign (%) is used in a different position.
General Purpose Numbers
There are four general-purpose number patterns. Remember that the "." and "," do not mean the literal characters: programs that use CLDR will change them to the right number symbols for your language!
||Used for currency values. A currency symbol (¤) is will be replaced by the appropriate currency symbol for whatever currency is being formatted. The choice of whether to use the international currency symbols (USD, EUR, JAY, RUB,…) or localized symbols ($, €, ¥, руб.,…) is up to the application program that uses CLDR. Note: the number of decimals will be set by programs that use CLDR to whatever is appropriate for the currency, so do not change them; keep exactly 2 decimals.
| currency-accounting|| ¤#,##0.00;(¤#,##0.00)||Used for currency formats in accounting contexts.|
|Used for formatting general decimal numbers. The number of decimals will be set by programs that use CLDR, so don't alter them. Typically the only change is to the position of the thousands separator (see above).
|Used for percent values, such as 12%. The number of decimals will be set by programs that use CLDR, so don't alter them.
|Used for scientific notation. Typically not translated.
There are also patterns for compact forms of numbers, such as the such as "1M" and "1 million". The pattern may be substantially different across languages, as can be seen by comparing the English patterns to the Japanese patterns in the table below.
The patterns have plural categories, because in some languages the text will inflect according to the number: that is, in those languages one writes "1 million" but "2 millions". The patterns do not allow for gender inflection, so the most neutral form should be chosen.
Remember that these are number patterns, so certain characters like a period (".") must be quoted if they are not the placeholder standing for the decimal period. See Pattern Characters.
||1 thousand = 1,000
If it is impossible to abbreviate numbers in that way in your language, then use a single 0 (zero digit) in your result. For example, the Japanese pattern for 1000 uses that. This should be avoided wherever possible, however, in that it may cause bad displays in devices with small screens, such as mobile phones.
The number of decimals can be changed by programs that use CLDR according to the task. For example, the pattern for 10,000 above (00K for English, 0.0万 for Japanese) may be modified to have more or fewer decimals — it could be changed to have 3 digits of accuracy: 00.0K for English, 0.00万 for Japanese.
Plural Forms of Numbers
Some languages have multiple plural forms for numbers, and will have multiple plural categories for each number. In such cases, look at the Plural Rules and Tool
to see what numbers are mapped to the various plural categories.