Roud an integer

raindrop3

Registered User.
Local time
Today, 21:18
Joined
Sep 6, 2001
Messages
98
Hello,

How can I roud down a integer (With VBA)? I.e. if I type 3,7 I want it to be 3 and not 4.

Thanks

Albert
 
This is from the help file.

Returns a value of the type passed to it containing the integer portion of a number.

Syntax

Int(number)
Fix(number)

The required number argument is a Double or any valid numeric expression. If number contains Null, Null is returned.

Remarks

Both Int and Fix remove the fractional part of number and return the resulting integer value.

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))
 

Users who are viewing this thread

Back
Top Bottom