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 Huan
Recipients Huan, mark.dickinson, umedoblock, valhallasw, zach.ware
Date 2017-07-30.11:45:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1501415101.56.0.895500821038.issue24827@psf.upfronthosting.co.za>
In-reply-to
Content
Hi Mark,

Thank you for your reply.

I went over again the answer from Zachary Ware published on 2015-08-08 09:36. I got the point that it is better to use string type of number.

>>> from decimal import Decimal, ROUND_HALF_UP
>>> Decimal("1.45")
Decimal('1.45')

>>> Decimal(Decimal("1.45").quantize(Decimal("0.1"), rounding=ROUND_HALF_UP))
Decimal('1.5')

I think it is better to make a tip in the Python tutorial.
History
Date User Action Args
2017-07-30 11:45:01Huansetrecipients: + Huan, mark.dickinson, valhallasw, umedoblock, zach.ware
2017-07-30 11:45:01Huansetmessageid: <1501415101.56.0.895500821038.issue24827@psf.upfronthosting.co.za>
2017-07-30 11:45:01Huanlinkissue24827 messages
2017-07-30 11:45:01Huancreate