Even though "first" is utterly different from "one", "1st" is just "1"
with a suffix.
RFE: add getSuffixFor(int) and getWordFor(int) to Locale? Typically,
there'll be some special cases for small enough integers (and an
illegal argument exception if argument <= 0?) and a simple algorithm
for larger integers. (In the case of English, starting at 20.) The
English algorithm for suffixes is especially simple, as it's just
if (arg > 10 && arg < 14) return "th";
switch (arg%10) {
case 1:
return "st";
case 2:
return "nd";
case 3:
return "rd";
default:
return "th";
}
(The only special cases are 11th, 12th, and 13th instead of 11st, 12nd,
and 13rd.)
The word one in English is similar -- you special-case 11, 12, and 13
("eleventh, twelfth, thirteenth" -- note you can't just add "th" or you
get "twelveth" for 12), and for the rest, you turn the LSD into an
ending "-first", "-second", "-third", or "-" + number's name + "th",
and the remaining digits into a beginning, e.g. "three hundred and
seventy", generating e.g. "three hundred and seventh-sixth".
Doing this for other languages is left as an exercise for the reader.
--
I am the terror that flaps in the net!
I am the leaky faucet in the kitchen of crime!
I am TWISTED!