Ask Your Question

alxymitr's profile - activity

2020-12-23 07:44:47 +0200 received badge  Editor (source)
2020-12-19 14:36:35 +0200 answered a question Correct way to get an exact number of decimal digits (after the point)
def Ns(x, nd = 5):
        # round x to a given number of significant digits 
        d = ceil(log(abs(x), 10))
        return round(x, ndigits = -d + nd)