random

Description

Returns a random number.

 float random( [ integer limit ] )

If called with no parameters, returns a floating-point number between 0.0 and 1.0.

If called with a single parameter, an integer, returns an integer between 0 (inclusive), and that number (exclusive). So for example, random(8)returns an integer in the range 0-7.

Example

{if random() < .3} 
<p>There is a 30% chance that this section will appear in the message.</p> 
{/if}
Top