minmax

Force the given value in the given range.

This clamps the filter value between the two filter arguments.

Example:

{% 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.

Edit on GitHub

min Numbers rand

Referred by

Filters

Filters transform template variables before they are rendered.