don't show decimals for 100% progress (100% instead of 100.00%)

This commit is contained in:
Nick Lanham 2011-04-28 14:26:01 +02:00
parent 751345fc28
commit 1be59bb116

View File

@ -63,7 +63,10 @@ def format_seeds_peers(num, total):
return "%d (%d)"%(num,total) return "%d (%d)"%(num,total)
def format_progress(perc): def format_progress(perc):
return "%.2f%%"%perc if perc < 100:
return "%.2f%%"%perc
else:
return "100%"
def format_pieces(num, size): def format_pieces(num, size):
return "%d (%s)"%(num,deluge.common.fsize(size)) return "%d (%s)"%(num,deluge.common.fsize(size))