Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4485996

RFE: Support for Ordinal Numbers in Internationalization

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P5 P5
    • None
    • 1.4.0
    • core-libs
    • generic
    • generic



      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)
      ======================================================================

            naoto Naoto Sato
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: