def _sizeof_fmt(num):
    for unit in ['bytes', 'KB', 'MB', 'GB', 'TB', 'PB']:
        if num < 1024.0:
            return '{0:3.1f} {1}'.format(num, unit)
        num /= 1024.0
Return disk format size data
dataset/ETHPy150Open saltstack/salt/salt/modules/dockerio.py/_sizeof_fmt