round(22.47,2) gives 22.469999999999999?
bh at intevation.de
Thu Aug 7 13:34:47 CEST 2003
sjmachin at lexicon.net (John Machin) writes:
>> int(22.47 + .5)
>> get you to where you want to go?
> Sure would, if 22 was where you wanted to go.
Even if he would want to round to an int, using int(x + 0.5) would fail
for negative values:
>>> int(-1.9 + 0.5)
Intevation GmbH http://intevation.de/
More information about the Python-list