Clib Get Integer Method
The Clib Get Integer method calculates and returns the integer part of a decimal number. The effect is identical to that of the Convert Value to Integer method. For more information, see Convert Value to Integer Method.
Format
Clib.modf(number, var intVar)
The following table describes the arguments for the Clib Get Integer method.
Argument | Description |
---|---|
number |
The floating-point number that this method splits. |
intVar |
Contains the integer part of the number. |
Example
The following example passes the same value to the Clib Get Integer method and to the Convert Value to Integer method. The result is the same for each method:
function eScript_Click ()
{
Clib.modf(32.154, var x);
var y = ToInteger(32.154);
TheApplication().RaiseErrorText("modf yields " + x +
".\nToInteger yields " + y + ".");
}
This example produces the following result:
modf yields 32
ToInteger yields 32.