Link to home
Start Free TrialLog in
Avatar of printmedia
printmedia

asked on

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?

Thank you in advance.
Avatar of printmedia
printmedia

ASKER

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

gary

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
Avatar of Mike McCracken
Try this

Round({YourNumber} + .005, 2)

mlmcc
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?
I did something like this:

if Number= 0 then
    formula = 0

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

end if


----------------
Does that look right?
Now I noticed a problem, when the number is 9.4500 it rounds it to 9.46 when it should be 9.45
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
worked great!
Glad i could help

mlmcc