from typing import Union


def remove_unnecessary_precision(number: float) -> Union[int, float]:
    """
    >>> remove_unnecessary_precision(59)
    59
    >>> remove_unnecessary_precision(59.0)
    59
    >>> remove_unnecessary_precision(59.1)
    59.1
    >>> remove_unnecessary_precision(59.10)
    59.1
    """
    if number == int(number):
        number = int(number)

    return number