Fix

Converts a real number to an integer

Method Signature

Fix(number=[numeric])

Arguments

Argument
Type
Required
Description
Default

number

numeric

true

The number to convert to an integer

Examples

Fix 1.8 to an integer

Run Example

fix( 1.8 );

Result: 1

Additional Examples

Run Example

writeOutput( fix( 7.546 ) );
 // 7

Last updated

Was this helpful?