import decimal


def format_coordinate(number: decimal.Decimal) -> str:
    """Returns decimal in the format required by task.

    2.0000 -> 2
    2.104 -> 2.1
    """
    return "{:.2f}".format(number).rstrip("0").rstrip(".")