def to_ordinal(n):
    """Get the suffixed number.

    Returns: a string with then number  and the appropriate suffix.

    >>> to_ordinal(1)
    '1st'
    >>> to_ordinal(2)
    '2nd'
    >>> to_ordinal(3)
    '3rd'
    >>> to_ordinal(4)
    '4th'
    >>> to_ordinal(11)
    '11th'
    >>> to_ordinal(12)
    '12th'
    >>> to_ordinal(13)
    '13th'
    """
    if n < 1:
        raise ValueError("n must be at least 1.")

    last_digit = n % 10

    if 11 <= (n % 100) <= 13:
        fmt = '%dth'
    elif last_digit == 1:
        fmt = '%dst'
    elif last_digit == 2:
        fmt = '%dnd'
    elif last_digit == 3:
        fmt = '%drd'
    else:
        fmt = '%dth'

    return fmt % n