5 Replies Latest reply on Nov 12, 2015 6:23 AM by TomHays

# How to round a number to the nearest hundredth higher ?

Hi everyone,

I hope i'll speak clearly because i'm not english...

I would like to know what formula to use to round automatically a number to the nearest hundredth higher... for example, if i got 14,12659 : it would be 14,13 ... but if the number is 14,12235, i'd also like it to be round at 14,13.

Can someone help me please ?!

Thanks!

• ###### 1. Re: How to round a number to the nearest hundredth higher ?

ceiling ( 14.12235 * 100 ) / 100

• ###### 2. Re: How to round a number to the nearest hundredth higher ?

Add 5/1000 to the number before rounding.

Round(theNumber + .005; 2)

-Tom

• ###### 3. Re: How to round a number to the nearest hundredth higher ?

If you use the round method it will round 14.12000 to 14.13000.

The ceiling method would keep it at 14.12

• ###### 4. Re: How to round a number to the nearest hundredth higher ?

Thank you very much !!

Finally, i've used this one -->  Round(theNumber + .01; 2) <-- because, the other one didn't give me the right total amount (it is for a bill).

Ingrid

• ###### 5. Re: How to round a number to the nearest hundredth higher ?

True.

The "round to the nearest hundredth higher" is somewhat ambiguous for what to do with numbers that have no digits in the thousands and smaller.

If no rounding is needed in those cases, something like

Round (theNumber + 0.004999999999999; 2) would address the issue in some fashion but is subject to a floating point roundoff error.

An alternative is to use a Case() and detect if the number does not need to be rounded (has nothing in thousands or smaller) and only use Round() if necessary.

Considering the needed workarounds, Ceiling is a more elegant method.