diff options
-rw-r--r-- | ttystatus/percent.py | 6 | ||||
-rw-r--r-- | ttystatus/progressbar.py | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/ttystatus/percent.py b/ttystatus/percent.py index ebe4e61..762cb82 100644 --- a/ttystatus/percent.py +++ b/ttystatus/percent.py @@ -35,10 +35,10 @@ class PercentDone(ttystatus.Widget): done = float(self.done) total = float(self.total) except ValueError: - done = 0 - total = 1 + done = 0.0 + total = 1.0 if total < 0.001: - total = 1 + total = 1.0 return '%.*f %%' % (self.decimals, 100.0 * done / total) def update(self, master): diff --git a/ttystatus/progressbar.py b/ttystatus/progressbar.py index 5c5663f..577f0fc 100644 --- a/ttystatus/progressbar.py +++ b/ttystatus/progressbar.py @@ -34,10 +34,10 @@ class ProgressBar(ttystatus.Widget): done = float(self.done) total = float(self.total) except ValueError: - done = 0 - total = 1 + done = 0.0 + total = 1.0 if total == 0: - fraction = 0 + fraction = 0.0 else: fraction = done / total n_stars = int(round(fraction * width)) |