- 3.6. Function reference
3.6.21. number() - 3.6.20. nl2br()
« Previous - 3.6.22. pad()
Next »
3.6.21. number()
| Reference | string number(number $num [, integer $decimals [, string $decimalSeparator [, string $thousandSeparator]]]) |
|---|
Formats the number $num in order to look nice in the text. The optional attributes specify the used format:
$decimals- the number of decimals to display$decimalSeparator- the separator of the integer and decimal part.$thousandSeparator- the thousand separator
Sample use:
<!-- print: "1,234.56" -->
{number(1234.567, 2, '.', ',')}
If the formatting arguments are not defined, the function reads the format from OPT configuration.
This function can operate also on a container of strings, operating on them all and returning the modified container.
- 3.6.21. number()
3.6. Function reference - « Previous
3.6.20. nl2br() - Next »
3.6.22. pad()