Skip to content Skip to footer navigation
🏰 Statamic Summit 2027 Feb 16–19 Talks, workshops, and three nights in a German castle. Get Tickets

Mod Modifier

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) }}
{{ Statamic::modify($glasses)->mod(14) }}
{{ Statamic::modify($glasses)->mod($bottles) }}
0
2
2