kilobyte megabyte etc is 1000 and not 1024. we could use KiB MiB if we want for 1024. more http://en.wikipedia.org/wiki/Kibibyte

This commit is contained in:
Nikos Kouremenos 2005-08-08 09:30:54 +00:00
parent d1b76f0a30
commit b0599ba788
1 changed files with 6 additions and 8 deletions

View File

@ -29,17 +29,15 @@ _ = i18n._
from common import gajim from common import gajim
def convert_bytes(string): def convert_bytes(string):
suffix = '' suffix = ''
bytes = int(string) bytes = int(string)
if bytes >= 1024: if bytes >= 1000:
bytes = round(bytes/1024.,1) bytes = round(bytes/1000., 1)
if bytes >= 1024: if bytes >= 1000:
bytes = round(bytes/1024.,1) bytes = round(bytes/1000., 1)
if bytes >= 1024: if bytes >= 1000:
bytes = round(bytes/1024.,1) bytes = round(bytes/1000., 1)
#Gb means giga bytes #Gb means giga bytes
suffix = _('%s Gb') suffix = _('%s Gb')
else: else: