number_format()
Usage
number_format(number, languageCode, pattern)
Description
Formats the given number in the given language according to the given pattern. This method uses the Java NumberFormat class which supports the ISO two-letter language codes, e.g. “en”, “de” etc. The following four pattern chars are supported:
Letter | Description |
---|---|
0 | Any number, or "0" |
# | Any number, or nothing |
. | The decimal separator |
, | The thousands-separator |
Example
${number_format(1.234, 'en', '###0.0000')}
${number_format(1234567, 'de', '0,000,000.0000')}
results in
1.2340
1.234.567,0000