show file size with 1 unit after the floating

point
This commit is contained in:
Dimitur Kirov 2005-08-07 12:55:34 +00:00
parent 578105a3ef
commit f700c53fd9
1 changed files with 4 additions and 7 deletions

View File

@ -35,21 +35,18 @@ def convert_bytes(string):
suffix = ''
bytes = int(string)
if bytes >= 1024:
bytes /= 1024
bytes = round(bytes/1024.,1)
if bytes >= 1024:
bytes /= 1024
bytes = round(bytes/1024.,1)
if bytes >= 1024:
bytes /= 1024
bytes = round(bytes/1024.,1)
suffix = _('%s Gb')
else:
suffix = _('%s Mb')
else:
suffix = _('%s Kb')
else:
if bytes == 1:
suffix = _('%s byte')
else:
suffix = _('%s bytes')
suffix = _('%s b')
return suffix % str(bytes)
def escape_for_pango_markup(string):