percentage
Format a number as a percentage. If you wish to remove trailing zeros, you may like to use percentage_clean
Parameters
{{ number | percentage: 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. | ’.’ |
Examples
{{ 12.3456 | percentage }}
This will produce 12.35%
{{ 12.3456 | percentage: 3, '.' }}
This will produce 12.346%