[Tutor] Money matters

Terry wildcard2007 at comcast.net
Thu Jun 28 20:55:00 CEST 2007


I am going to need to be handling money calculations and was wondering
about the float problem 
in my calculations.

Should I simply run the results of all calculations through something
like this:

from __future__ import division
...
...
s=(int(round(s, 2)*100))/100

Or should I be using Decimal on all money calculations?

Or, is there another more preferred approach?







-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070628/3f6e4fab/attachment.html 


More information about the Tutor mailing list