This seems to be known as an Ordinal Indicator.
Here's the blurb for convenience, some formatting lost from Wikipedia like the actual subscripts:
In written languages, an ordinal indicator is a character, or group of characters, following a numeral denoting that it is an ordinal number, rather than a cardinal number.
In English orthography, this corresponds to the suffixes -st, -nd, -rd, -th in written ordinals (represented either on the line 1st, 2nd, 3rd, 4th or as superscript, st, 2nd, 3rd, 4th).
Also commonly encountered are the superscript (and often underlined) ordinal indicators º and ª, originally from Romance, but via the cultural influence of Italian by the 18th century widely used in the wider cultural sphere of Western Europe, as in 1º primo and 1ª prima "first, chief; prime quality".
The practice of underlined (or doubly underlined) superscripted abbreviations was common in 19th-century writing (not limited to ordinal indicators in particular, and also extant in the Numero sign №), and was also found in handwritten English until at least the late 19th century (e.g. "first" abbreviated 1st or 1st).