Modifier: mod


Get the modulus value (remainder after division) of a value split by another numeric value. Pass an integer or the name of a second variable as the parameter. Also supports % as shorthand.

bottles: 3
glasses: 14
{{ glasses | mod:14 }}
{{ glasses | mod:bottles }}
{{ glasses | %:bottles }}

0
2
2

Additional Reading

Learn how to use and chain modifiers in the Antlers template guide.

Last modified on March 31, 2016