From 6d0c30e56cf5a86d37c2305326ea88622334b546 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Mon, 11 Apr 2016 20:41:28 +0100 Subject: use % formatter --- ranger/gui/widgets/statusbar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/gui/widgets/statusbar.py b/ranger/gui/widgets/statusbar.py index 33aa4296..aa359c9a 100644 --- a/ranger/gui/widgets/statusbar.py +++ b/ranger/gui/widgets/statusbar.py @@ -291,7 +291,7 @@ class StatusBar(Widget): elif pos >= max_pos: right.add('Bot', base, 'bot') else: - right.add('{0:0>.0f}%'.format(100.0 * pos / max_pos), + right.add('{:0.0%}'.format(pos / max_pos), base, 'percentage') else: right.add('0/0 All', base, 'all') -- cgit 1.4.1-2-gfad0 From ba6c7358470d34a95953547fd323a82ec10f401f Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Sat, 7 May 2016 09:46:35 +0100 Subject: bug fix for % formatter change The values pos and max_pos are both integers, but we want to use floating point division. --- ranger/gui/widgets/statusbar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/gui/widgets/statusbar.py b/ranger/gui/widgets/statusbar.py index aa359c9a..8786af06 100644 --- a/ranger/gui/widgets/statusbar.py +++ b/ranger/gui/widgets/statusbar.py @@ -291,7 +291,7 @@ class StatusBar(Widget): elif pos >= max_pos: right.add('Bot', base, 'bot') else: - right.add('{:0.0%}'.format(pos / max_pos), + right.add('{:0.0%}'.format(float(pos) / max_pos), base, 'percentage') else: right.add('0/0 All', base, 'all') -- cgit 1.4.1-2-gfad0