max
Take the maximum of the filter value and its first argument.
Usage with two values
Take the maximum of the filter value and its first argument.
{% print 102 | to_integer | max:103 %}
Prints 103.
Usage with two values
Take the maximum of the filter value and its first argument::
{{ 102|max:103 }}
Prints 103.
Usage with lists
Find the maximum value in a list::
{% print [1, 5, 3, 9, 2] | max %}
Prints 9.
Edge cases
undefined | maxreturnsundefinedundefined | max:1000returnsundefined[] | max(empty list) returnsundefinedWorks with translation tuple values.
See also