Skip to content

Commit

Permalink
pydf: Fix percent string formatting
Browse files Browse the repository at this point in the history
e.g. str(39.1) is formatted on some platforms as 39.100000000000001
  • Loading branch information
xsteve committed Sep 13, 2018
1 parent 5996c59 commit 987d78d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pydf
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ def get_row_mp(mp):
avail_f = myformat(inodes_avail, sizeformat, 1)
try:
perc = round(100.*inodes_used/inodes_size, 1)
perc_f = str(perc)
perc_f = "%2.1f" % perc
except ZeroDivisionError:
perc = 0
perc_f = '-'
Expand All @@ -425,7 +425,7 @@ def get_row_mp(mp):
avail_f = myformat(avail, sizeformat, fs_blocksize)
try:
perc = round(100.*used/size, 1)
perc_f = str(perc)
perc_f = "%2.1f" % percstr(perc)
except ZeroDivisionError:
perc = 0
perc_f = '-'
Expand Down

0 comments on commit 987d78d

Please sign in to comment.