Closed watermelon0guy closed 2 months ago
Thanks for the report, this looks like a duplicate of https://github.com/jazzband/prettytable/issues/243.
As a workaround, set the format after adding the rows:
import prettytable as pt
arr = [1.3310884083630156e-05, 6.655442041815078e-06, 5.546201701512565e-06]
table = pt.PrettyTable()
table.add_row(arr)
table.float_format = "0.8"
print(table)
+------------+------------+------------+
| Field 1 | Field 2 | Field 3 |
+------------+------------+------------+
| 0.00001331 | 0.00000666 | 0.00000555 |
+------------+------------+------------+
What did you do?
Format floats in table using
float_format
What did you expect to happen?
Expect suppressing scientific notation
What actually happened?
Nothing changed
What versions are you using?
Please include code that reproduces the issue.