How to truncate/round-off decimal numbers?

jean-michel bain-cornu jmbc at nospam.fr
Wed Jun 21 04:33:07 EDT 2006


> just a thought: if you *always* work with "floats" with two decimals,
> you are in fact working with integers, but you represent them as a
> floats - confusing for the internal representation.
> 
> So why not work with int(float * 100) instead? This way you only have
> to take care of roundoffs etc when dividing.
And why won't you work with decimal module ?



More information about the Python-list mailing list