Link to home
Start Free TrialLog in
Avatar of SaraniaRajendran
SaraniaRajendran

asked on

RoundUp function for a Number in Oracle

I would like to RoundUp a number to its higher number using an Oracle Function ? (RoundUp should work similar to the RoundUp function in Excel).

For Example:

RoundUp ( 1.12 ) to 2
RoundUp ( 1.79 ) to 2
RoundUp ( 0.15 ) to 1
RoundUp ( 0.75 ) t0 1

Please Help??
Avatar of mjblake
mjblake

There is no roundup function in Oracle.  You can create a stored function in your database to do that.  Or just use the round function and add .5 to the number being rounded.

SQL> select round(1.112+.5) from dual;

ROUND(1.112+.5)
---------------
              2

SQL> select round(1.9+.5) from dual;

ROUND(1.9+.5)
-------------
            2

ASKER CERTIFIED SOLUTION
Avatar of mjblake
mjblake

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
Avatar of SaraniaRajendran

ASKER

Thanks so much. It works Great!!!
I have another question.

When I perfom this RoundUp function, if the Number is an Even Number or NULL, how do I perform this ROUNDUP function.

Could anyone please help?