Raymond Hettinger <[EMAIL PROTECTED]> added the comment: 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") ---------- nosy: +rhettinger _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3024> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com