Il 29/11/12 10:49, Joe Barnhart ha scritto:
Hmmm...

That would give "3" since Python 2.x keeps the calculation as integer (it won't coerce it to a float).

He could do a=int(a)/100.0 But that puts it into a floating point value, and rounding sometimes gives surprising and unexpected results.
my 2 cent...

a = round(int(a)/100, 3)

    M.

--



Reply via email to