Closed
Description
>>> round(Decimal('0.5'))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File ".venv/lib/python2.7/site-packages/future/builtins/newround.py", line 42, in newround
d = Decimal.from_float(number).quantize(exponent,
File "/Users/tpict/.asdf/installs/python/2.7.16/lib/python2.7/decimal.py", line 690, in from_float
n, d = abs(f).as_integer_ratio()
AttributeError: 'Decimal' object has no attribute 'as_integer_ratio'
The newround
function doesn't check if the input is of type Decimal
before trying to convert it to one.
Metadata
Metadata
Assignees
Labels
No labels