def format_file_size(size):
    """according file size return human format

    Arguments:
        size {int} -- file size

    Returns:
        str -- human format file size
    """
    if size < 1024:
        return '%i' % size + 'B'
    if 1024 <= size < 1024 ** 2:
        return '%.1f' % float(size / 1024) + 'K'
    if 1024 ** 2 <= size < 1024 ** 3:
        return '%.1f' % float(size / 1024 ** 2) + 'M'
    if 1024 ** 3 <= size < 1024 ** 4:
        return '%.1f' % float(size / 1024 ** 3) + 'G'
    return 'n/a'