The function ecm:random returns a random positive integer between two integers. The result can include the values used to define the upper and lower ranges. The value returned is an integer data type.

${ecm:random(3, 6)}
CODE

This returns an integer value from the range 3 to 6, for example, 5.

Structure​

ecm:random(integer, integer)

Parameters​

Parameter

Description

integer

Specifies the lower range of the result.

integer

Specifies the upper range of the result.

If either parameter is entered as a negative integer or the lower range value is greater than the upper range, the function returns a value of -1