precision
Rounds off and formats a number to a given precision.
Specification
{{ number | precision: decimals=2, separator='.', delimiter=',' }}
Parameter | Description | Example Values |
---|---|---|
number (required) | The number you wish to format to a given precision. | 12.3456 |
decimals | The number of decimal places to round the number off to. | 2 |
separator | Specifies the fractional separator. | ”.” |
delimiter | Specifies the thousands separator. | ”,” |
Examples
{{ 123456.789 | precision }}
This will produce 123,456.79
{{ 123456.789 | precision: 1, '.', ',' }}
This will produce 123,456.8