contents.gifindex.gifprev1.gifnext1.gif

Fix

Purpose

Return the integer portion of a number.

Arguments

Fix( number )

Notes

The argument number can be any valid numeric expression. Fix removes the fractional part of number and returns the resulting integer value. If the number is negative, Fix returns the first negative integer greater than or equal to number. See Int.

The data type of the return value is the same as that of the number argument. However, if number is a Variant of VarType 8 (String) that can be converted to a number, the return type will be a Variant of VarType 5 (Double). If the numeric expression results in a Null, Int returns a Null.

The difference between Int and Fix is that if number is negative, Int returns the first negative integer less than or equal to number, whereas 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.

Fix( number ) is equivalent to:

Sgn( number ) * Int( Abs(number) )