def size2str(size):
    """Converts a file size into a string"""
    if size >= 1000000000:
        return str(size // 1048576) + 'M'
    elif size >= 10000000:
        return str(size // 1024) + 'K'
    else:
        return str(size)
