< Day Day Up > |
RandomCategory: Number Syntax: Random Parameters: None Description: Returns a random number between zero and one. When used in a field definition, a new value is generated when the formula is updated. It is also updated anytime the formula re- evaluates , such as when other field values referenced in the formula change. In an unstored calculation, the Random() function re-evaluates each time the field is displayed. Examples: Round (Random ; 5) Might return .07156 . Comments: If you want to generate a random integer in a certain range, multiply the result returned by the random function by the range you want to produce, then use the Int() , Floor() , Ceiling() , Round() , or Truncate() functions to remove the decimals. For instance, to return a random number from 1 to 6 (as in the roll of a die), use the formula: Ceiling (Random * 6) If you need to specify a lower bound for the random number, just add the bound to the results of the random number. For instance, to return a random number between 10 and 100, inclusive, use the following formula: Int (Random * 91) + 10 |
< Day Day Up > |