proper prefix for size - ticket #178

This commit is contained in:
Marcos Pinto 2007-06-10 02:04:12 +00:00
parent 72e34d4d87
commit 07a73f6039
1 changed files with 3 additions and 3 deletions

View File

@ -54,12 +54,12 @@ def get_eta(size, done, rate):
def fsize(fsize_b): def fsize(fsize_b):
fsize_kb = float (fsize_b / 1024.0) fsize_kb = float (fsize_b / 1024.0)
if fsize_kb < 1000: if fsize_kb < 1000:
return '%.1f KB'%fsize_kb return '%.1f KiB'%fsize_kb
fsize_mb = float (fsize_kb / 1024.0) fsize_mb = float (fsize_kb / 1024.0)
if fsize_mb < 1000: if fsize_mb < 1000:
return '%.1f MB'%fsize_mb return '%.1f MiB'%fsize_mb
fsize_gb = float (fsize_mb / 1024.0) fsize_gb = float (fsize_mb / 1024.0)
return '%.1f GB'%fsize_gb return '%.1f GiB'%fsize_gb
# Returns a formatted string representing a percentage # Returns a formatted string representing a percentage
def fpcnt(dec): def fpcnt(dec):