Message299498
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. |
|
Date |
User |
Action |
Args |
2017-07-30 11:45:01 | Huan | set | recipients:
+ Huan, mark.dickinson, valhallasw, umedoblock, zach.ware |
2017-07-30 11:45:01 | Huan | set | messageid: <1501415101.56.0.895500821038.issue24827@psf.upfronthosting.co.za> |
2017-07-30 11:45:01 | Huan | link | issue24827 messages |
2017-07-30 11:45:01 | Huan | create | |
|