Click or drag to resize

int Function

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
int Function

The int function converts a given expression to an integer value.

Any precision after the decimal point will be lost in the conversion.

Caution note Caution

The int function will not round an expression to the nearest integer value. Instead, int will simply strip the decimal portion of the numeral.

To round a real number to the nearest integer value consider using the math.round function.

Syntax

Alchemy
int(expr);

Nomenclature

expr Required. An expression to convert to an integer

Returns

An whole-number integer value.

Examples

Alchemy
$pi = 3.1416;
PRINT int($pi); /* 3 */

Note how the int function strips the decimal portion of the given expression:

Alchemy
PRINT int(7.9); /* 7 */