Adapt unit to SI standards: Kb/Mb -> KB/MB

Lowercase b means 'bit' while uppercase means 'byte':
http://en.wikipedia.org/wiki/Megabyte
This commit is contained in:
Oren Held 2012-03-09 20:55:54 +02:00
parent 20b618c789
commit eb096fb29c
1 changed files with 3 additions and 3 deletions

View File

@ -147,11 +147,11 @@ def normalize_name(name):
def format_size(bytes):
if bytes > 1000*1000:
return '%.1fMb' % (bytes/1000.0/1000)
return '%.1fMB' % (bytes/1000.0/1000)
elif bytes > 10*1000:
return '%iKb' % (bytes/1000)
return '%iKB' % (bytes/1000)
elif bytes > 1000:
return '%.1fKb' % (bytes/1000.0)
return '%.1fKB' % (bytes/1000.0)
else:
return '%ibytes' % bytes