def get_size_to_pretty(the_size, in_bits=False):
    """
    Get a pretty string of a number of bits or bytes
    :param the_size: The Size in bits or bytes
    :param in_bits: Should the pretty string show bits?
    :return: A pretty string, reduced version of the_size
    """
    if the_size >= 1000000:
        return '%d%s' % (the_size / 1000000, 'MBit' if in_bits else 'MByte')
    elif the_size >= 1000:
        return '%d%s' % (the_size / 1000, 'KBit' if in_bits else 'KByte')
    return '%d%s' % (the_size, 'Bits' if in_bits else 'Bytes')