drugiej - 2nd (feminine, singular, dative)
dwiema, dwoma - two (instrumental)
czterech - 4 (masculine, accusative)
dwunastej - 12th (feminine, singular, locative)
siedemnastym - 17th (masculine, instrumental)
These are simply numerals with grammatical suffixes. In fact they shouldn't be spelled tat way, the official version is that you should just write a number and a dot but sometimes people still spell it that way.
(Yeah, we inflect numerals by case, gender and, for ordinals, even number)