Return a string containing an approximate representation of
    *num_bytes* using a small number and decimal SI prefix.

def filesize(num_bytes):
    """Return a string containing an approximate representation of
    *num_bytes* using a small number and decimal SI prefix."""
    for prefix in '-KMGTEPZY':
        if num_bytes < 999.9:
            break
        num_bytes /= 1000.0
    if prefix == '-':
        return '{} B'.format(num_bytes)
    return '{:.3n} {}B'.format(num_bytes, prefix)