[an error occurred while processing this directive]
Forms Processor Advanced Commands
Contents   Index of Commands   Search the Forms Processor Docs   
int Round a floating point number to an integer. Primarily used when generating random numbers.

$output = int(n);

Example:

#Randomize and generate some dice rolls

$Dummy_Value=srand();
$DiceRoll1=int(rand(6))+1;
$DiceRoll2=int(rand(6))+1;

format screen
<HTML>
<HEAD>
<TITLE>Random Numbers - Results of Die Roll</TITLE>
</HEAD>

<BODY>

<H1>Results of Die Roll</H1>

Die one: $DiceRoll1<br>
Die two: $DiceRoll2<br>

</BODY>
</HTML>
.



See also:  rand(n) function  srand(n) function [an error occurred while processing this directive]