def ToOrdinal(value):
    """
    Convert a numerical value into an ordinal number.
    @param value: the number to be converted
    """
    if value % 100//10 != 1:
        if value % 10 == 1:
            ordval = '{}st'.format(value)
        elif value % 10 == 2:
            ordval = '{}nd'.format(value)
        elif value % 10 == 3:
            ordval = '{}rd'.format(value)
        else:
            ordval = '{}th'.format(value)
    else:
        ordval = '{}th'.format(value)

    return ordval