filter_format_integer (zotonic_mod_base v1.0.0-rc.17)

Show an integer value.

Formats an integer value as a list, assuming a radix of ten.

For example:

{{ value|format_integer }}

When the value is the integer 123 then the output is the list 123.

The format_integer filter has an optional argument to pad the returned string with zeros to a fixed length. For example:

{{ 123|format_integer:5 }}

Will output 00123. And when the number does not fit:

{{ 123|format_integer:2 }}

Will output “**”.

Note: This option only works for positive integers.

See also

to_integer, format_number, format_price, format_duration

Summary

Functions

format_integer/2

format_integer/3