diff --git a/src/future/builtins/newround.py b/src/future/builtins/newround.py index 3943ebb6..b0e6a001 100644 --- a/src/future/builtins/newround.py +++ b/src/future/builtins/newround.py @@ -38,11 +38,14 @@ def newround(number, ndigits=None): if 'numpy' in repr(type(number)): number = float(number) - if not PY26: - d = Decimal.from_float(number).quantize(exponent, - rounding=ROUND_HALF_EVEN) + if isinstance(d, Decimal): + d = number else: - d = from_float_26(number).quantize(exponent, rounding=ROUND_HALF_EVEN) + if not PY26: + d = Decimal.from_float(number).quantize(exponent, + rounding=ROUND_HALF_EVEN) + else: + d = from_float_26(number).quantize(exponent, rounding=ROUND_HALF_EVEN) if return_int: return int(d)