From 9649ebca2540856fc80c4b4ae526fab2acf7f34c Mon Sep 17 00:00:00 2001 From: Noe Brucy Date: Wed, 1 Dec 2021 22:54:06 +0100 Subject: [PATCH] [units] fix a bug in display with coeff --- units.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/units.py b/units.py index f811fb9..8ab046a 100644 --- a/units.py +++ b/units.py @@ -43,7 +43,7 @@ def unit_str(unit, base=None, prefix="", format=" [{unit}]"): return "" elif base is not None: coeff = unit.express(base) - u_str = unit_str(base, prefix=convert_exp(coeff) + " ") + return unit_str(base, prefix=convert_exp(coeff) + " ") elif len(unit.latex) > 0: if "." in unit.latex or "^" in unit.latex: base_str = ".".join(map(parse_exp_unit, unit.name.split(".")))