VirtualMailManager/common.py
changeset 601 463b10c258d9
parent 586 cd1200d06700
child 609 56ec275911f2
equal deleted inserted replaced
600:0571f45501da 601:463b10c258d9
    84     for prefix, multiply in prefix_multiply:
    84     for prefix, multiply in prefix_multiply:
    85         if size >= multiply:
    85         if size >= multiply:
    86             # TP: e.g.: '%(size)s %(prefix)s' -> '118.30 MiB'
    86             # TP: e.g.: '%(size)s %(prefix)s' -> '118.30 MiB'
    87             return _(u'%(size)s %(prefix)s') % {
    87             return _(u'%(size)s %(prefix)s') % {
    88                     'size': locale.format('%.2f', float(size) / multiply,
    88                     'size': locale.format('%.2f', float(size) / multiply,
    89                                           True),
    89                                           True).decode(ENCODING, 'replace'),
    90                     'prefix': prefix}
    90                     'prefix': prefix}
    91 
    91 
    92 
    92 
    93 def size_in_bytes(size):
    93 def size_in_bytes(size):
    94     """Converts the string `size` to a long (size in bytes).
    94     """Converts the string `size` to a long (size in bytes).