I wrote a quick little plugin to calculate the modulo value and figured I’d share it here.
In computing, the modulo operation finds the remainder of division of one number by another.
Given two numbers, a (the dividend) and n (the divisor), a modulo n (abbreviated as a mod n) is the remainder, on division of a by n. For instance, the expression “7 mod 3” would evaluate to 1, while “9 mod 3” would evaluate to 0. Although typically performed with a and n both being integers, many computing systems allow other types of numeric operands.
Parameters
1) Dividend (required)
2) Divisor (required)
{exp:modulo dividend="dividend" divisor="divisor"}
For example:
{exp:modulo dividend="3" divisor="3"} => 0
{exp:modulo dividend="4" divisor="3"} => 1
{exp:modulo dividend="5" divisor="3"} => 2
{exp:modulo dividend="6" divisor="3"} => 0
Hope it saves you some time…..
Best,
David
