ecm:random
    • 1 Minute to read
    • Dark
      Light

    ecm:random

    • Dark
      Light

    Article summary

    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)}

    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


    Was this article helpful?

    What's Next