Click to See Complete Forum and Search --> : rounding down -howto?


jericho
08-13-2003, 05:28 AM
How to round the float variable down?

If I use round(), it rounds up or down to the nearliest number.

So...

round (5.4) / 5
round (5.6) / 6

How to round down? In both examples I would like to have 5 as a result. How do I do that?

I suppose I could subtract 0.5 from the float number first and then use round, but perhaps there is another way to do that... Is there a function like round.down?

DaiWelsh
08-13-2003, 05:49 AM
floor()

jericho
08-13-2003, 08:45 AM
Yay! Thx!

DaiWelsh
08-13-2003, 11:25 AM
np