unsupported operand type(s) for *: 'float' and 'Decimal'
www.py4u.net › discuss › 186717The simplest solution is to rewrite any reference to amount declaring it as a Decimal object: self.amount = decimal.Decimal(float(amount)) and in initialize: self.amount = decimal.Decimal('0.0') Another option would be to declare Decimals in your final line: return (decimal.Decimal(float(self.amount)) * self.VAT).quantize(decimal.Decimal(float ...
Some functions do not accept scalar Decimal input · Issue ...
github.com › numpy › numpyJul 10, 2019 · There are some functions that fail when passed Decimal objects as scalar inputs. I'm not particularly interested in using Decimal arrays, for obvious reasons, but the lack of scalar support limits our ability (see Turbo87/utm#40) to use numpy as a 'better' math module in a certain sense. I'm not sure if you would consider this a bug or not.