Int()

Syntax

Int(n)

Remarks

Returns the integer part of a decimal number n. If n is greater than or equal to 32,768 or less than or equal to –32,769, an error occurs.

Examples

This example sets the variable x to 98:


x = Int(98.6)

The following example sets x to –9.


x = Int(-9.6)

The following function rounds a decimal number to the nearest whole number.


Function fRoundOff(x)
    fRoundOff = Int(x + 0.5 * Sgn(x))
End Function

See Also

Abs(), Rnd(), Sgn()