percentage_clean
Formats a number as a percentage, but will clean off trailing zeros after the separator.
Parameters
{{ number | percentage_clean: precision=2, separator='.' }}
Parameter | Description | Example Values |
---|---|---|
number (required) | The number that you wish to format as a percentage. | 123.45 |
precision | The number of decimal places that you wish to round the percentage to. | 2 |
separator | What separator to use. | ’.’ |
Example Usage
{{ 12.0000 | percentage_clean: 2, '.' }}
This will produce 12%