random_number

random_number

Generates a random number with a few parameters to customise your results

Example

[%random_number length:'5'/%]

When both min and max are defined, the function will return a random number between the two, excluding max value. E.g if min equals 4 and max equals 10, then it will generate number will be between 4 and 9:

[%random_number min:'4' max:'10'/%]

When either one of min or max are not defined they will be ignored completely. Instead, fix will be used (If length is provided it will be used as well, however this is not required).

random_number Parameters

Name Options Description
length:'' Integer This is a required param to set the length of the number generated
timestamp:'' 1/0 Can be used instead of the length param or along side it. Generates a number with the time stamp.
id:'' String Used to duplicate results on the page, if you have two random_number tags with the same ID, the resulting random number string will be the same on both.
min:'' Integer The shortest length the resulting number can be. Can not be used with the length param
max:'' Integer The longest length the resulting number can be. Can not be used with the length param
fix:'' 1 / 0 When true it will force the length of the result to be exactly the length param. Can not be used with the min/max params

Was this article useful?

Be notified when this page is updated. Optional.