Skip to content

Commit

Permalink
fix pretty table int parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
sirfoga committed Oct 5, 2018
1 parent 893d810 commit f0b274e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.0.6 (5a003ca60496dc6114aa4480d8d93136be69bcdd at 11:29:23 18-10-05 +0200)
10.0.6 (e8259985459aa00a051bfc9cd929f753cb4d1c6c at 22:10:08 18-10-05 +0200)
6 changes: 5 additions & 1 deletion hal/streams/pretty_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ def _parse(self):
for j, col in enumerate(row):
try:
x = float(col)
self.data[i][j] = self.num_format.format(x)
if (x % 1) == 0: # integer
x = int(col)
self.data[i][j] = str(x)
else:
self.data[i][j] = self.num_format.format(x)
except:
self.data[i][j] = str(self.data[i][j])

Expand Down

0 comments on commit f0b274e

Please sign in to comment.