Skip to content

Commit

Permalink
Adapt unit to SI standards: Kb/Mb -> KB/MB
Browse files Browse the repository at this point in the history
Lowercase b means 'bit' while uppercase means 'byte':
http://en.wikipedia.org/wiki/Megabyte
  • Loading branch information
Oren Held committed Mar 9, 2012
1 parent 20b618c commit eb096fb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pip/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit eb096fb

Please sign in to comment.