I am attempting to convert an ordinal string, say "FOURTH" to integer 4. How can I accomplish this with the International Components for Unicode library for Java, icu4j?
RuleBasedNumberFormat formatter = new RuleBasedNumberFormat(Locale.US, RuleBasedNumberFormat.ORDINAL);
return formatter.parse("FOURTH").intValue();
Seems like this is not working, as 0 is being returned. I'm expecting this to return 4.
Any help would be appreciated. Thank you.