Size.__div__ converts the Decimal result to a Size, which rounds its numerical argument (byte count) down to an integer. Size.convertTo is meant to retain precision. --- blivet/size.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/blivet/size.py b/blivet/size.py index 4c23c11..f2a32ce 100644 --- a/blivet/size.py +++ b/blivet/size.py @@ -269,7 +269,7 @@ class Size(Decimal): check = _makeSpecs(prefix, abbr, False)
if spec in check: - return Decimal(self / Decimal(factor)) + return Decimal(Decimal(self) / Decimal(factor))
return None