Int

Returns the closest integer that is smaller than the number

Method Signature

Int(number=[numeric])

Arguments

Argument
Type
Required
Description
Default

number

numeric

true

The number to calculate the closest integer for

Examples

Closest integer less than 1.8

Run Example

int( 1.8 );

Result: 1

Additional Examples

Run Example

writeDump( int( 7.0 ) ); // 7
writeDump( int( 6.9 ) ); // 6
writeDump( int( -2.9 ) );
 // -3

Last updated

Was this helpful?