VirtualMailManager/common.py
branchv0.6.x
changeset 394 d3a3c6155879
parent 393 fb2ba1456bc5
child 395 0a13849243f2
equal deleted inserted replaced
393:fb2ba1456bc5 394:d3a3c6155879
    76     for unit, limit in unit_limit:
    76     for unit, limit in unit_limit:
    77         if size >= limit:
    77         if size >= limit:
    78             if unit != 'b':
    78             if unit != 'b':
    79                 return '%.2f%s' % (size / float(limit), unit)
    79                 return '%.2f%s' % (size / float(limit), unit)
    80             else:
    80             else:
    81                 return '%u%s' % (size / limit, unit)
    81                 return '%ub' % size
    82 
    82 
    83 
    83 
    84 def size_in_bytes(size):
    84 def size_in_bytes(size):
    85     """Converts the string `size` to a long (size in bytes).
    85     """Converts the string `size` to a long (size in bytes).
    86 
    86