def integer(number: float):
    """Convert a float to an int if they have the same value.
       For example convert 1.0 to 1."""
    try:
        int_n = int(number)
        return int_n if number == int_n else number
    except:
        return number
