Skip to content

Commit fdefde6

Browse files
committed
clean up
1 parent 07e9ef6 commit fdefde6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tabulate.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -995,16 +995,16 @@ def _format(val, valtype, floatfmt, missingval="", has_invisible=True):
995995
if is_a_colored_number:
996996
print("HIIIIII", val)
997997
raw_val = _strip_invisible(val)
998-
formatted_val = format(Decimal(str(raw_val)), floatfmt)
998+
formatted_val = format(float(val), floatfmt)
999999
return val.replace(raw_val, formatted_val)
10001000
else:
10011001
context = Context(clamp=1, prec=6)
10021002
setcontext(context)
10031003
try:
10041004
if "f" in floatfmt:
10051005
if int(Decimal(val)) == Decimal(val):
1006-
val = int(Decimal(val, context=context))
1007-
val = Decimal(str(val), context=context)
1006+
val = int(Decimal(val))
1007+
val = Decimal(str(val))
10081008
else:
10091009
val = float(val)
10101010
except (OverflowError, ValueError):

0 commit comments

Comments
 (0)