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 Hakim.Taklanti
Recipients Hakim.Taklanti
Date 2013-01-29.16:14:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1359476056.94.0.303954404669.issue17072@psf.upfronthosting.co.za>
In-reply-to
Content
>>> from decimal import Decimal
>>> from decimal import ROUND_UP, ROUND_DOWN
>>> a = Decimal("-3.86")
>>> b = Decimal("5.73")
>>> a_up = a.quantize(Decimal(".1"), ROUND_UP)
>>> a.quantize(Decimal(".1"), ROUND_UP) # -3.8 expected
Decimal('-3.9') 
>>> a.quantize(Decimal(".1"), ROUND_DOWN) # -3.9 expected
Decimal('-3.8') 
>>> b.quantize(Decimal(".1"), ROUND_UP) # Ok
Decimal('5.8')
>>> b.quantize(Decimal(".1"), ROUND_DOWN) # Ok
Decimal('5.7')
History
Date User Action Args
2013-01-29 16:14:16Hakim.Taklantisetrecipients: + Hakim.Taklanti
2013-01-29 16:14:16Hakim.Taklantisetmessageid: <1359476056.94.0.303954404669.issue17072@psf.upfronthosting.co.za>
2013-01-29 16:14:16Hakim.Taklantilinkissue17072 messages
2013-01-29 16:14:16Hakim.Taklanticreate