{jr_random_number}
The {jr_random_number} template function is used to create a random number in a template.
Parameters:
Name |
Type |
Required |
Default |
Description |
assign |
string |
yes |
n/a |
The "assign" parameter is required by the {jr_random_number} function - you should enter the name of the template variable to store the random number in. |
min |
number |
no |
0 |
The"min" parameter tells Jamroom the minimum number the result can be. |
max |
number |
no |
10 |
The "max" parameter tells Jamroom the maximum number the result can be. |
Example:
Example embedding the {jr_random_number} template function into a template:
{jr_random_number min="2" max="5" assign="rand_number"}
{if $rand_number == "2"}
... number is 2! ...
{elseif $rand_number == '3'}
... number is 3! ...
{elseif $rand_number == '4'}
... number is 4! ...
{else}
... number is 5! ...
{/if}
|
|