logo
Home XtGem- Templates- XtScript- bottom
XtGemmanual

XtGem tags and tools

xt random

Random number generator
HTML only

Notes

Generate a random number from value to value inclusive
If from is ommitted
0
is used for the from argument

to is always required
<xt:random to="10000"/>
8582
Multiple calls on one page using the same values will produce the same result
<xt:random from="0" to="10000"/>
9548
9548
To fix this add another argument/value pair I'm using x but any name will do
<xt:random from="0" to="10000" x="1"/>
4978
Change the value of x to change the result
<xt:random from="0" to="10000" x="2"/>
721
The value and name of the extra parameter can be almost anything
It is just there to make the function call unique so that the cached value is not used
<xt:random from="0" to="10000" banana="custard"/>
9700

XtGem manual · all sections

Powered by XtGem
About us Contact Forum top