From 1be59bb1160ff90866e41f21eea3e4af409ee91d Mon Sep 17 00:00:00 2001 From: Nick Lanham Date: Thu, 28 Apr 2011 14:26:01 +0200 Subject: [PATCH] don't show decimals for 100% progress (100% instead of 100.00%) --- deluge/ui/console/modes/format_utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/deluge/ui/console/modes/format_utils.py b/deluge/ui/console/modes/format_utils.py index 6783acf47..fa064f812 100644 --- a/deluge/ui/console/modes/format_utils.py +++ b/deluge/ui/console/modes/format_utils.py @@ -63,7 +63,10 @@ def format_seeds_peers(num, total): return "%d (%d)"%(num,total) def format_progress(perc): - return "%.2f%%"%perc + if perc < 100: + return "%.2f%%"%perc + else: + return "100%" def format_pieces(num, size): return "%d (%s)"%(num,deluge.common.fsize(size))