See Also: Type Conversion Functions, Integer, Number, Real, Round, String
The Integer function returns a value of type Integer from an input of another type.
(Integer( {expression} ))
Where:
{expression} cannot be of type string (unless it contains a numeric value that can be converted to an integer)
The Integer function converts the {expression} into an integer. It eliminates the fractional portion (digits to the right of the decimal point) from the value of an expression.
String sValue
Move "-8.3782" to sValue
Move (Integer(sValue)) to iTabulation
In this example, the value -8 is moved to the variable iTabulation.
The Integer function does not change the type of the {expression}. It only affects the numeric precision to which {expression} is converted.
When used inside an expression, integer affects only the precision of its own expression, not that of the evaluation of the overall expression.
Number nResult nMean
Move (3.14 * Integer(nMean)) to nResult
This example would output 3.14 times the integer of the value of the number variable nMean to the number variable nResult in the full precision of number variables.
Real and number values are converted to integer values by truncation of the decimal portion of the value. To round to integers, use the round function.
Integers can be used as Booleans values. A value of 0 is Boolean false, and any other value, positive or negative, is true.