def convert(stat):
    """Convert byte value to pretty string"""
    size = 1024 * 1024 * 1024 * 1024 * 1024
    for mag in ['P', 'T', 'G', 'M', 'K']:
        if stat > size:
            return "%10.2f %s" % (float(stat) / size, mag)
        size = size / 1024
    return "%10d  " % stat