This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ammar2
Recipients ammar2, nathan snobelen
Date 2016-08-05.22:03:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1470434604.46.0.70016127609.issue27697@psf.upfronthosting.co.za>
In-reply-to
Content
You've ran into a classic floating point number limitation. 
Please read the following doc page: https://docs.python.org/2/tutorial/floatingpoint.html

The problem comes when you multiply the number by 100, which is what causes the precision loss and drops it by a penny.

>>> 1108431.38 * 100
110843137.99999999
>>> int(110843137.99999999)
110843137

If this is for currency, I would suggest you use the decimal module https://docs.python.org/2/library/decimal.html
History
Date User Action Args
2016-08-05 22:03:24ammar2setrecipients: + ammar2, nathan snobelen
2016-08-05 22:03:24ammar2setmessageid: <1470434604.46.0.70016127609.issue27697@psf.upfronthosting.co.za>
2016-08-05 22:03:24ammar2linkissue27697 messages
2016-08-05 22:03:24ammar2create