def get_ordinal_str(num):
    return str(num) + ('th' if 11 <= num % 100 <= 13 else {1: 'st', 2: 'nd', 3: 'rd'}.get(num % 10, 'th'))
dataset/ETHPy150Open dnanexus/dx-toolkit/src/python/dxpy/templating/utils.py/get_ordinal_str/original