if "int" in self.type.precision:
self.precision_fmt = "%d"
else:
match = re.search(".+<(.+?)>", self.type.precision)
if match is not None:
precision_bits = match.group(1).split(",")
decimal_bits = int(precision_bits[0]) - int(precision_bits[1])
decimal_spaces = int(np.floor(np.log10(2 ** decimal_bits - 1))) + 1
self.precision_fmt = "%.{}f".format(decimal_spaces)
else:
self.precision_fmt = "%f"
After Change
// to right of decimal point
decimal_spaces = len(str(lsb).split(".")[1])
else:
decimal_spaces = len(str(2**integer_bits))
self.precision_fmt = "%.{}f".format(decimal_spaces)
else:
self.precision_fmt = "%f"