diisplay bugfix

This commit is contained in:
Noe Brucy
2022-06-02 10:36:56 +02:00
parent 124f24f92c
commit a65a89df3a
3 changed files with 41 additions and 23 deletions
+2 -2
View File
@@ -25,9 +25,9 @@ def convert_exp(number, digits=4):
exp = splitted[1]
exp_str = "10^{" + str(int(exp)) + "}"
if float(coeff) == 1.0:
return exp_str
return f"${exp_str}$"
else:
return "{}\\times {}".format(coeff, exp_str)
return f"${coeff}\\times {exp_str}$"
def unit_str(unit, base=None, prefix="", format=" [{unit}]"):