Huan Wang added the comment:
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(&qu
Huan Wang added the comment:
Hello,
I was confused by the decimal module. The problem is that I want to
from decimal import Decimal, ROUND_HALF_UP
def rounded(number, n):
''' Round the digits after the n_th decimal point by using
decimal module in python.