Converts a number to its ordinal representation.

    :param value: number

    >>> print(ordinal(1))
    1st
    >>> print(ordinal(11))
    11th
    >>> print(ordinal(101))
    101st
    >>> print(ordinal(104))
    104th
    >>> print(ordinal(113))
    113th
    >>> print(ordinal(123))
    123rd

def ordinal(value):
    '''
    Converts a number to its ordinal representation.

    :param value: number

    >>> print(ordinal(1))
    1st
    >>> print(ordinal(11))
    11th
    >>> print(ordinal(101))
    101st
    >>> print(ordinal(104))
    104th
    >>> print(ordinal(113))
    113th
    >>> print(ordinal(123))
    123rd
    '''

    try:
        value = int(value)
    except (TypeError, ValueError):
        raise ValueError

    if value % 100 in (11, 12, 13):
        return '%d%s' % (value, ORDINAL_SUFFIX[0])
    else:
        return '%d%s' % (value, ORDINAL_SUFFIX[value % 10])