Lines Matching refs:ndigits
343 def round2(number, ndigits=None): argument
357 if ndigits is None:
358 ndigits = 0
360 if ndigits < 0:
361 exponent = 10 ** (-ndigits)
367 exponent = _decimal.Decimal('10') ** (-ndigits)
383 def round3(number, ndigits=None): argument
384 return _round(number) if ndigits is None else _round(number, ndigits)
393 def round3(number, ndigits=None): argument
414 if ndigits is None:
415 ndigits = 0
426 m = number * (10 ** ndigits)
430 if ndigits < 0:
431 exponent = 10 ** (-ndigits)
438 exponent = _decimal.Decimal('10') ** (-ndigits) if ndigits != 0 else 1
444 d = round2(number, ndigits)