Int Function |
Microsoft.VisualBasic.Conversion
Int( number )
The number to be processed
Returns a value of the data type passed to it
Returns the integer portion of a number
The fractional part of number is removed, and the resulting integer value is returned. Int does not round number to the nearest whole number. For example, Int(100.9) returns 100.
If number is negative, Int returns the first negative integer less than or equal to number . For example, Int(-10.1) returns -11.
Int and Fix work identically with positive numbers. However, for negative numbers , Fix returns the first negative integer greater than number , while Int returns the first negative integer less than number . For example, Fix(-10. 1) returns -10, while Int(-10.1) returns -11.
Don't confuse the Int function with CInt . CInt casts the number passed to it as an Integer data type, whereas Int returns the same data type that was passed to it.
CInt Function, Fix Function, Round Function