Did I find the right examples for you? yes no

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)

        def hrData(byte):
    try:
        byte = int(byte)
    except:
        byte = 0
    size = byte / 1024.0
    unit = 'KB'
    if size > 1024:
        size = size / 1024.0
        unit = 'MB'
    if size > 1024:
        size = size / 1024.0
        unit = 'GB'
    if size > 1024:
        size = size / 1024.0
        unit = 'TB'
    return '{:.2f}{}'.format(size, unit)
        


src/m/a/MacOSX-Kits-HEAD/python/kits/rsync.py   MacOSX-Kits(Download)
            output = '{:.2%} ({}/{}) {} | {}/s'.format(
                progress, finished_num, total_num, 
                util.hrData(finished_size), util.hrData(speed)
            )
        else:
            output = '{} {} | {}/s'.format(finished_num, util.hrData(finished_size), util.hrData(speed))