CitectVBA Programming Reference > CitectVBA Function Reference > Math/Trigonometry Functions > Int

Int

Calculates the integer portion of a number. Int does not round the number, and ignores the fractional value of the number.

Int expects the argument (Num) to be a valid numeric value. If the argument value is positive, rounds the Num down by dropping any fractional value. If the argument value is negative, rounds the Num down to the next integer number less than or equal to Num.

Do not confuse Int with Fix, which rounds a negative argument value (Num) up to the next integer number greater than or equal to Num.

Syntax

Int(Num)

Num:

An Integer or expression representing a valid numeric value.

Return Value

Returns the integer value of the number (Num) provided in the argument. If Num contains a Null, Int returns a Null.

Related Functions

Abs | Fix | Rnd | Sgn | Sqrt

Example

Dim vntVar
vntVar = Int(99.2) ' returns 99
vntVar = Int(99.8) ' returns 99
vntVar = Int(-99.8) ' returns -100
vntVar = Int(-99.2) ' returns -100