2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-25 03:08:27 +08:00

units: support direct float conversion

This commit is contained in:
Sebastien Bourdeauducq 2015-02-16 07:48:05 -07:00
parent 021d0d312e
commit 61dc177bce

View File

@ -117,6 +117,9 @@ class Quantity:
else:
return str(r_amount) + " " + self.unit
def __float__(self):
return float(self.amount)
# mul/div
def _binop(self, other, opf_name, dim_function):
opf = getattr(self.amount, opf_name)