6.1.2.3.1.18 Int

Returns the integer portion of a number.

Function Declaration

 Function Int(Number As Variant) 

Parameter

Description

Number

Any data value (section 2.1).

 

Runtime Semantics.

§ If the data value of Number is Null, Null is returned.

§ If the value type (section 2.1) of Number is Integer, Long or LongLong, the data value of Number is returned.

§ If the value type of Number is any numeric value type (section 5.5.1.2.1) other than Integer or Long, the returned value is a data value whose value type is the same as the value type of Number and whose value that is the greatest integer that is less than or equal to the data value of Number. If the value to be returned is not in the range of the value type of Number, raise error 6, "Overflow".

§ If the value type of Number is String, the returned value is the result of the Int function applied to the result of Let-coercing Number to Double.

§ If the value type (section 2.1) of Number is Date, the returned value is the same as result of evaluating the expression: CDate(Int(CDbl(Number)))

§ Otherwise, the returned value is the result of Number being Let-coerced to Integer.