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(".")))