(n, min_value=None, max_value=None)
return n
Round a number to an integer.
    It saves having to use a ton of brackets in certain situations.
Round a number to an integer.
    It saves having to use a ton of brackets in certain situations.
Round a number to an integer . It saves having to use a ton of brackets in certain situations .
def round_int(n, min_value=None, max_value=None):
    """Round a number to an integer.
    It saves having to use a ton of brackets in certain situations.
    """
    if not isinstance(n, int):
        try:
            n = int(round(float(n)))
        except TypeError:
            raise TypeError('value is not a valid number: {}'.format(n))
    if min_value is not None:
        n = max(n, min_value)
    if max_value is not None:
        n = min(n, max_value)
    return n
def round_int ( n , min_value = None , max_value = None ) : if not isinstance ( n , int ) : try : n = int ( round ( float ( n ) ) ) except TypeError : raise TypeError ( 'value is not a valid number: {}' . format ( n ) ) if min_value is not None : n = max ( n , min_value ) if max_value is not None : n = min ( n , max_value ) return n