I need to convert a number to its rank.
1 -> "First"
2 -> "Second"
3 -> "Third"
- %simplified (this gives 'one', 'two', 'three' etc.)
- %default (this gives 'one', 'two', 'three' etc.)
- %main (this gives 1st, 2nd, 3rd etc.)
The code in first link throws an exception (for rule set "%simplified-ordinal") that it is unknown 'rule-set'
The question is already asked on SO (link below) and tried one of its solution but did not work.
Links I've already referred to are:
Is there a way in Java to convert an integer to its ordinal?
http://icu-project.org/apiref/icu4j/com/ibm/icu/text/RuleBasedNumberFormat.html
I believe there is some 'rule-set' I need to pass to get what I'm looking for, but I'm not able to find it.