Skip to main content

This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRISOpens in a new window, see the InterSystems IRIS Adoption Guide and the InterSystems IRIS In-Place Conversion Guide, both available on the WRC Distributions pageOpens in a new window (login required).

Previous sectionNext section


Returns the integer portion of a number.




The number argument can be any valid numeric expression.


Int removes the fractional part of number and returns the resulting integer value. The Int and Fix functions are almost functionally identical:

For positive values, both Int and Fix truncate number. If you wish to round a number to the nearest integer, use the Round function.

For negative values, Int returns the first negative integer less than or equal to number. Fix returns the first negative integer greater than or equal to number. For example, Int converts -8.4 to -9, and Fix converts -8.4 to -8.

Both Int and Fix remove leading zeros and plus signs from number.


The following examples illustrate how the Int and Fix functions return integer portions of numbers:

Println Int(99.8)      ' Returns 99.
Println Fix(99.8)      ' Returns 99.
Println Int(+99.20)    ' Returns 99.
Println Fix(+0099.2)   ' Returns 99.
Println Int(0.00)      ' Returns 0.
Println Fix(0.00)      ' Returns 0.
Println Int(-99.8)     ' Returns -100.
Println Fix(-99.8)     ' Returns -99.
Println Int(-99.2)     ' Returns -100.
Println Fix(-99.2)     ' Returns -99.
Copy code to clipboard

See Also

FeedbackOpens in a new window