Fetching contributors…
Cannot retrieve contributors at this time
17 lines (8 sloc) 383 Bytes

Force the given value in the given range.

This clamps the filter value between the two filter arguments.


{% print 3|to_integer|minmax:10:20 %}

This will print 10, since that is the minimum value allowed.

Passing in undefined will not clamp the value but return undefined.

.. seealso:: :ref:`filter-max`, :ref:`filter-min`