SQL function ROUND will round number with respect to the next digit.
Basically ROUND(15.68)=16 and
ROUND(15.43)=15
we have TRUNC to round downwards
TRUNC(15.68)=TRUNC(15.43)=15
Then how to round up wards?
This is very commonly needed function but a many of us are not aware of.. I used to add one and truncate to get the result. I found a function to round up very recently.
Function used is CEIL
Now,
CEIL(15.68)=CEIL(15.43)=16
Thank you..
Basically ROUND(15.68)=16 and
ROUND(15.43)=15
we have TRUNC to round downwards
TRUNC(15.68)=TRUNC(15.43)=15
Then how to round up wards?
This is very commonly needed function but a many of us are not aware of.. I used to add one and truncate to get the result. I found a function to round up very recently.
Function used is CEIL
Now,
CEIL(15.68)=CEIL(15.43)=16
Thank you..
No comments:
Post a Comment