The mgiRandomNumber Tag

Tag Behavior

The mgiRandomNumber tag displays a random number within a specified range and/or with a specified number of digits.


Tag Syntax

The mgiRandomNumber tag has no required parameters and three optional parameter. The tag form is:

<mgiRandomNumber upperBound="Integer" lowerBound="Integer" 
digits="Integer">

Required Parameters:

  • None.

Optional Parameters:

  • upperBound="Integer" where "Integer" is a whole number that defines the largest value of a range from which numbers are randomly chosen. Range boundaries and digits are mutually exclusive. If the digits parameter is included, it is used to generate the random number and the boundaries are ignored.
  • lowerBound="Integer" where "Integer" is a whole number that defines the smallest value of a range from which numbers are randomly chosen. Range boundaries and digits are mutually exclusive. If the digits parameter is included, it is used to generate the random number and the boundaries are ignored.
  • digits="Integer" where "Integer" is a whole number that defines the number of digits in the random number. Range boundaries and digits are mutually exclusive. If the digits parameter is included, it is used to generate the random number and the boundaries are ignored.


Example Usage and Output

<mgiRandomNumber>

In this example, a random number between 1 and 4,294,967,295 will be displayed.

<mgiRandomNumber upperBound="1000" lowerBound="1">

In this example, a random number between 1 and 1000 will be displayed.

<mgiRandomNumber digits="5">

In this example, a random number between 10000 and 99999 will be displayed.


Suggested Usage

  • Password Protection
  • Unique Database Data
  • Browser Caching Problems


[Return to the Referencing MGI Menu]


[User Guide Main Menu] [Understanding MGI Menu] [Using MGI Menu] [Referencing MGI Menu]