Merge pull request #117 from rotx/fix-multiply

Fix multiplication of Decimal with float
This commit is contained in:
Patrick762 authored and GitHub committed 2024-06-30 15:03:14 +02:00
commit 52853d6d3e
1 file changed
+1 -1
@@ -91,7 +91,7 @@ class DecimalField(DeviceField):
def parse(self, data: bytes) -> Decimal:
val = Decimal(struct.unpack("!H", data)[0])
return (val / 10 ** self.scale) * self.multiplier
return (val / 10 ** self.scale) * Decimal(self.multiplier)
def in_range(self, val: Decimal) -> bool:
if self.range is None: