Rounding Up

J

Joe Williams

Is there a function to always round UP? For instance, 24.1, 24.6, and 24.9
should all be 25 in my application. I looked at the round function but did
not see that it does this.

Thanks

Joe
 
A

Allen Browne

Int() always rounds down, so:
- negate the value;
- apply Int();
- negate the result.

You should therefore be able to use:
-Int(-[MyField])
 
R

Randy Balbuena

Joe said:
Is there a function to always round UP? For instance, 24.1, 24.6, and 24.9
should all be 25 in my application. I looked at the round function but did
not see that it does this.

Thanks

Joe

Joe, please try the following expression to round up negative and positive
numbers appropriately

Iif(mynum>=0, abs(int(mynum*(-1))), int(mynum))

4 will be 4
4.1 will be 5
-4.1 will be -5
-4 will be -4

Does that help?
 
Top