# Is there a RoundUp function in Crystal Reports?

Hi all.

I want to use the RoundUp function that is used in Excel (Rounds a number up, away from 0) in Crystal Reports, but it does not work.

Is there a similar function, if not, how do I get Crystal to round up?

###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Author Commented:
By the way I want to Round to 2 decimal places.
0
Commented:
can you please post an example;

gary
0
Author Commented:

The  function in excel is like this: Roundup(number, numberofDigitstoRound)

Roundup(0.1470, 2) = 0.15

Roundup(0.1838, 2) = 0.19

Roundup(2.1840, 2) = 2.19

Roundup(1, 2) = 1
0
Commented:
Try this

Round({YourNumber} + .005, 2)

mlmcc
0
Author Commented:
Thanks mlmcc, but when the following the number is 0 it rounds it up to 0.01 and it should be equal to 0.

In excel:  Roundup(0,2) = 0

Any idea?
0
Author Commented:
I did something like this:

if Number= 0 then
formula = 0

else
formula = Round( Number + .005, 2)

end if

----------------
Does that look right?
0
Author Commented:
Now I noticed a problem, when the number is 9.4500 it rounds it to 9.46 when it should be 9.45
0
Commented:
Try
Round( Number + .0049, 2)

mlmcc
0

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Author Commented:
worked great!
0
Commented: