From 583b3d4a56087e33988dba1edc2bf4a5dc2eb80a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Reich=C3=B6r?= Date: Thu, 13 Sep 2018 15:05:26 +0200 Subject: [PATCH] pydf: Fix percent string formatting e.g. str(39.1) is formatted on some platforms as 39.100000000000001 --- pydf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pydf b/pydf index 5f2a3bc..f423456 100755 --- a/pydf +++ b/pydf @@ -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 = '-' @@ -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" % perc except ZeroDivisionError: perc = 0 perc_f = '-'