July 19, 2006 at 6:45 pm
Hello,
Can anyone help me?
I want to round up my result.
I use round ((value/60),0). It works ok when
The result
11.91 becomes 12
when the result is 4.03 becomes 4 ( in mathematical theory is correct) but I want to be able to round up this to 5 instead of 4.
what should I do? Any suggestion
Basically I want my result appear like below
11.91 becomes 12
0.5 becomes 1
10.1 becomes 11
18.45 becomes 19
40.83 becomes 41
Thanks,
Susan
July 19, 2006 at 7:48 pm
Use round ((value/60.0)+0.5, 0)
or even better CEILING(value/60.0)
_____________
Code for TallyGenerator
July 19, 2006 at 8:02 pm
Thanks,,,
It works well
July 22, 2006 at 9:03 am
I tried using /60 and it did not work for me, i changed to /1.0 and it works ok?
round((value/1.0)+0.5, 0)
JJ
July 23, 2006 at 8:40 am
Jimmy...
Can't use just 60... that would imply integer math. It has to be 60.0 to imply that it's a float calculation with decimal places. I also believe that "value" is probably some number of seconds and Susan is trying to round the time up to the nearest whole minute. Hence, the number "60.0". Same would hold true for rounding minutes up to hours.
--Jeff Moden
Change is inevitable... Change for the better is not.
July 23, 2006 at 3:58 pm
I am using ceiling ( value/60) and it looks ok..
I will try your suggestion, Jeff
thanks every one
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply