3.6. Function reference
3.6.21. number()
3.6.20. nl2br()
« Previous
3.6.22. pad()
Next »

3.6.21. number()

Referencestring 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:

  1. $decimals - the number of decimals to display
  2. $decimalSeparator - the separator of the integer and decimal part.
  3. $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()