harvester/utils/__init__.py
def to_ordinal(number):
    """Return the "ordinal" representation of a number"""

    assert isinstance(number, int)

    sr = str(number)  # string representation
    ld = sr[-1]  # last digit

    try:
        # Second to last digit
        stld = sr[-2]
    except IndexError:
        stld = None

    if stld != '1':
        if ld == '1':
            return sr + 'st'
        if ld == '2':
            return sr + 'nd'
        if ld == '3':
            return sr + 'rd'

    return sr + 'th'
Return the "ordinal" representation of a number
Return the "ordinal" representation of a number
Return the " ordinal " representation of a number
def to_ordinal(number):
    assert isinstance(number, int)
    sr = str(number)  
    ld = sr[-1]  
    try:
        stld = sr[-2]
    except IndexError:
        stld = None
    if stld != '1':
        if ld == '1':
            return sr + 'st'
        if ld == '2':
            return sr + 'nd'
        if ld == '3':
            return sr + 'rd'
    return sr + 'th'
def to_ordinal ( number ) : assert isinstance ( number , int ) sr = str ( number ) ld = sr [ - 1 ] try : stld = sr [ - 2 ] except IndexError : stld = None if stld != '1' : if ld == '1' : return sr + 'st' if ld == '2' : return sr + 'nd' if ld == '3' : return sr + 'rd' return sr + 'th'
Return the "ordinal" representation of a number
Return the " ordinal " representation of a number
"""Return the "ordinal" representation of a number""" # string representation # last digit # Second to last digit
number