Wiki source code of Rand
Last modified by Achraf El Kari on 2024/08/06 13:05
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | = Introduction = | ||
2 | |||
3 | The Rand function creates a random whole number for various uses. | ||
4 | |||
5 | = Parameters = | ||
6 | |||
7 | * Case 1 (1 param) => exponent (Type: Double): Determines the range of the random number. A higher exponent means a larger range. | ||
8 | * Case2 : (2 param) => Get a random number between two numbers | ||
9 | |||
10 | = Return ValueType: = | ||
11 | |||
12 | A whole number randomly generated and rounded. | ||
13 | |||
14 | = Uses = | ||
15 | |||
16 | Case 1 : Get random number with 10 digits | ||
17 | |||
18 | {{code language="XML"}} | ||
19 | <TEST><xsl:value-of select="ixf:Rand('10')"></xsl:value-of></TEST> | ||
20 | {{/code}} | ||
21 | |||
22 | |||
23 | Case 2 : Get a random number between 3 and 7 | ||
24 | |||
25 | {{code language="XML"}} | ||
26 | <TEST><xsl:value-of select="ixf:Rand('3','7')"></xsl:value-of></TEST> | ||
27 | {{/code}} | ||
28 | |||
29 | == Note == | ||
30 | |||
31 | The Rand function provides diverse and unpredictable values. |