Formats a number in a human-friendly representation.
It supports the following parameters:
precision: The number of decimals to which to round the number, or if the significant options is set to true, the number of significant digits to round to. Defaults to nil (no rounding).significant: If set to true, rounds to the given number of significant digits instead of the number of decimals. Defaults to false.strip_insignificant_zeros: If set to true, removes any trailing zeros after the decimal point. Defaults to false.separator: The character that represents the decimal point. Defaults to '.'.delimiter: The character that acts as the thousands separator. Defaults to nil (no delimiter).{{ 42 | number: precision: 2 }}
{{ 42 | number: precision: 2, strip_insignificant_zeros: true }}
{{ 123.456 | number: precision: 2, significant: true }}
{{ 55.55 | number: precision: 1, separator: ',' }}
{{ 150000000 | number: delimiter: ',', precision: 0 }}
{% comment %}
Output:
42.00
42
120
55,6
150,000,000
{% endcomment %}