From ee728e661709b1469260a349c6629abc0fea9691 Mon Sep 17 00:00:00 2001 From: hroff-1902 <47309513+hroff-1902@users.noreply.github.com> Date: Mon, 20 Apr 2020 13:30:24 +0300 Subject: [PATCH] Resolve percentage rounding issue --- progressbar/bar.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/progressbar/bar.py b/progressbar/bar.py index e6d32977..7270cbc9 100644 --- a/progressbar/bar.py +++ b/progressbar/bar.py @@ -405,11 +405,11 @@ def percentage(self): elif self.max_value: todo = self.value - self.min_value total = self.max_value - self.min_value - percentage = todo / total + percentage = 100.0 * todo / total else: - percentage = 1 + percentage = 100.0 - return percentage * 100 + return percentage def get_last_update_time(self): if self._last_update_time: