int
int ( number : number ) : number
Parameter | Type | Description | |
---|---|---|---|
number | number | -> | Number whose integer portion is returned |
Result | number | <- | Integer portion of number |
Description
int
returns the integer portion of number. int
truncates a negative number away from zero.
Example
The following example illustrates how int
works for both positive and negative numbers. Note that the decimal portion of the number is removed:
var vlResult : number
vlResult = int(123.4) // vlResult gets 123
vlResult = int(-123.4) // vlResult gets –124