JDK-4485996 : RFE: Support for Ordinal Numbers in Internationalization
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.text
  • Affected Version: 1.4.0
  • Priority: P5
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2001-07-30
  • Updated: 2024-10-09
  • Resolved: 2015-10-16
Related Reports
Duplicate :  
Relates :  
Description

Name: rmT116609			Date: 07/30/2001


java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

How about about support for ordinal numbers?
I wanted to be able to get a Locale specific ordinal number given an integer.

For example:
1     in English would return 1st
1     in Portuguese would return 1a

I think this feature would be very welcome.

Just as the English abbreviation of "first" is 1st and "second" is 2nd and "third" is 3rd 
and the other numbers end with "th".

Other languages have their own abbreviation. For instance: in Portuguese first" can be
abbreviated as 1a. (I know the abbreviation in Portuguese because it?s my native tongue.)

Every language has its own rules for abbreviating ordinal numbers. I think it would be useful 
if I there was a method to which I'd pass a number and it would return me its matching ordinal 
number abbreviation in a localized way.

For example:
    
If I were using a "en", "US" locale:

        getOrdinalNumberAbbreviation(4)

 would return the string "4th"

        getOrdinalNumberAbbreviation(22)

would return the string "22nd"  and so on...

If I were using another locale, it would return a locale-specific abbreviation of the number.
(Review ID: 129061) 
======================================================================

Comments
Dup of JDK-5077787
16-10-2015

EVALUATION I'm not seeing a whole lot of demand for this feature, and it seems it would be best to treat this as a third party opportunity after we create a pluggable locale support SPI (see RFE 4052440). ###@###.### 2003-01-22
22-01-2003