Help me please : Rounding-down numbers

Joseph joseph.redimerio at baesystems.com
Wed Mar 26 19:08:01 EST 2003


Hello,

I have a floating number which I need to "round-down" to the nearest
whole number. I am doing this by type-casting it as an "int". Would
this work all the time ? Or is there any instances when this will
"round-up" ?  I need to round-down all the time as I need to spearate
the whole number from the fraction part.

eg., given 5.326,  I need to separate 5  from  .326
     if it rounds-up sometimes, then I'll end up with 6 and .326

Cheers,
Joseph 74




More information about the Python-list mailing list