number

Description

Formats a number for display.

 string number( float number [, mixed precision ] )

Format a number by rounding and adding comma separators. By default, number()will round off to the nearest integer value. If you pass a number in the second parameter, it will round to that number of decimal places.

For more precise control over number formatting, you may pass a string in the second parameter instead. This string will be passed to Java’s DecimalFormat class.

Example

 {number(37521.5299,2)} = 37,521.53
Top