The random() Function

Release 2.0 - ...

Syntax

  CopyCode image Copy Code
number random(boolean?)

Description

This function generates and returns a uniformly distributed random or pseudorandom number in the range from 0.0 up to but excluding 1.0.

This function accepts an author-optional boolean parameter that is false by default. If true, the random number generator for this function is first seeded with a source of randomness before generating the return value.

Example

XML CopyCode image Copy Code
<xforms:output value="random()">
   <xforms:label>Random number : </xforms:label>
</xforms:output>

Specification

Link to the XForms specification: the random() function.