pamac-classic/pamac/common.py

12 lines
245 B
Python
Raw Normal View History

2013-01-16 15:09:52 -03:00
#! /usr/bin/python
# -*-coding:utf-8-*-
def format_size(size):
KiB_size = size / 1024
if KiB_size < 1000:
size_string = '%.1f KiB' % (KiB_size)
return size_string
else:
size_string = '%.2f MiB' % (KiB_size / 1024)
return size_string