# Rounding

## Recommended Posts

Hi everybody i am having serious trouble. I have a total cost field that i am trying to have round up or down to the nearest .05

Round ( (Cost + Sales Tax) ; .05 )

i have tried that but it almost always gives me a whole amount

EX. \$4.47 = \$4.00

What i would like is for \$4.47 to equal \$4.45

so please any help would be greatly appreciated

Edited by Guest

##### Share on other sites

Try:

Round ( n / 0.05 ; 0 ) * 0.05

##### Share on other sites

Perfect! thank you comment

##### Share on other sites

comment im sorry but i was wrong i need it to only round down if you could be so nice to help me again

##### Share on other sites

Rather obvious, no?

Floor ( n / 0.05 ) * 0.05

##### Share on other sites

that is working great but on occasion it will round when it shouldnt

EX.

24.45 + 1.25 = 25.70

but it will take that and round it to 25.65

##### Share on other sites

Most likely, your data is not what you think it is - e.g. the 1.25 is actually 1.249999999.

##### Share on other sites

you were right as always but is there a way to make it not do that? im guessing i would have to put a round calculation in the sales tax calculation field?

##### Share on other sites

so i think i got it would this be right

Ceiling ( (Cost * .051) * 10 ^ 2 ) * 10 ^ -2

Edited by Guest

##### Share on other sites

There's no single correct answer here - it all depends on the reason behind the rounding. Obviously, if you're rounding twice, you may get a discrepancy. It's best to round EITHER the tax OR the total.

## Create an account or sign in to comment

You need to be a member in order to leave a comment

## Create an account

Sign up for a new account in our community. It's easy!

Register a new account