rfmassa
asked on
Access Rounding Up to Nearest $5
Hi.
I am trying to find a way to round up any given decimal or integer number to the nearest $5 or $0.
Example: $178.92 rounds up to $180, $199.01 rounds up to $200, $231 rounds up $235.
I am using Access 2000 and am trying to do this within an Access update query if possible. The built in rounding function cannot handle this as it will round down as well as up, I beleive. I have tried using the Int() function and get close, but there is always an exception that seems to fail.
I don't mind if I have to write a function, but it seems it should not be that difficult.
Thanks.
I am trying to find a way to round up any given decimal or integer number to the nearest $5 or $0.
Example: $178.92 rounds up to $180, $199.01 rounds up to $200, $231 rounds up $235.
I am using Access 2000 and am trying to do this within an Access update query if possible. The built in rounding function cannot handle this as it will round down as well as up, I beleive. I have tried using the Int() function and get close, but there is always an exception that seems to fail.
I don't mind if I have to write a function, but it seems it should not be that difficult.
Thanks.
ASKER
The StackOverflow I had seen before posting this, but it does not seem to work, as it will round down as well which is not acceptable in this situation for me.
Thanks.
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Genius. Perfect Solution. Thank you!
http://stackoverflow.com/questions/326476/how-to-round-a-number-in-vba-to-the-nearest-5-or-10-or-x
Seems to suit your needs.