Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)

        def format_filesize(size, locale='en'):
    locale = Locale.parse(locale)
    value, unit = human_readable_size(size)
    return format_decimal(value, format=u'#,##0.#', locale=locale) + u'\xa0' + unit
        


src/m/e/mediadrop-HEAD/mediadrop/lib/helpers.py   mediadrop(Download)
from mediadrop.lib.auth import viewable_media
from mediadrop.lib.compat import any, md5
from mediadrop.lib.filesize import format_filesize
from mediadrop.lib.i18n import (N_, _, format_date, format_datetime, 
    format_decimal, format_time)
def pretty_file_size(size):
    """Return the given file size in the largest possible unit of bytes."""
    if not size:
        return u'-'
    return format_filesize(size, locale=translator.locale)