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 rhettinger
Recipients helminthe, loewis, rhettinger
Date 2008-06-01.22:51:35
SpamBayes Score 0.052377865
Marked as misclassified No
Message-id <1212360696.11.0.594954321415.issue3024@psf.upfronthosting.co.za>
In-reply-to
Content
This is exactly what int() is supposed to do.  For other kinds of 
rounding, look at round(), math.floor(), math.ceil(), and many rounding 
options in the decimal module:

from decimal import Decimal
>>> Decimal('-23.15').to_integral(ROUND_FLOOR)
Decimal("-24")
>>> Decimal('-23.15').to_integral(ROUND_CEILING)
Decimal("-23")
>>> Decimal('-23.15').to_integral(ROUND_DOWN)
Decimal("-23")
>>> Decimal('-23.15').to_integral(ROUND_HALF_EVEN)
Decimal("-23")
History
Date User Action Args
2008-06-01 22:51:36rhettingersetspambayes_score: 0.0523779 -> 0.052377865
recipients: + rhettinger, loewis, helminthe
2008-06-01 22:51:36rhettingersetspambayes_score: 0.0523779 -> 0.0523779
messageid: <1212360696.11.0.594954321415.issue3024@psf.upfronthosting.co.za>
2008-06-01 22:51:35rhettingerlinkissue3024 messages
2008-06-01 22:51:35rhettingercreate