def get_ordinal_string(n):
    """
    Return the ordinal representation of a positive integer (e.g. 1 -> "1st")
    Code by CTT @ http://stackoverflow.com/a/739301
    """
    if 10 <= n % 100 < 20:
        return str(n) + 'th'
    else:
       return  str(n) + {1 : 'st', 2 : 'nd', 3 : 'rd'}.get(n % 10, "th")