def fileSizeString(num, suffix='B', div=1000) ->str:
    """
    Returns a human-readable file size string.
    thanks to Fred Cirera
    http://stackoverflow.com/questions/1094841/reusable-library-to-get-human-readable-version-of-file-size
    :param num: number in bytes
    :param suffix: 'B' for bytes by default.
    :param div: divisor of num, 1000 by default.
    :return: the file size string
    """
    for unit in ['', 'K', 'M', 'G', 'T', 'P', 'E', 'Z']:
        if abs(num) < div:
            return '{:3.1f}{}{}'.format(num, unit, suffix)
        num /= div
    return '{:.1f} {}{}'.format(num, unit, suffix)
