mod

Summary

Returns the modulo of two parameters.

Usage

input|mod( value1 [,value2] )

Parameters

NameTypeDescriptionRequired
value1 number Divisor or dividend. Yes.
value2 number Divisor or dividend. Only if the input parameter is omitted.

Returns

Integer (the modulo of the supplied parameters).

Description

This operator returns the modulo (rest after division) of the first parameter divided by the second. The operator can also take an input parameter. If the input parameter is used, then it will be divided by the first parameter (and thus the second parameter will be ignored).

Examples

Example 1

{5|mod( 3 )}

or

{mod( 5, 3 )}

The following output will be produced: "2".

Example 2

{6|mod( 3, 7 )}

The following output will be produced: "0".

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2013 eZ Systems AS (except where otherwise noted). All rights reserved.