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

Accounting currency format support

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Draft
    • Priority: P4
    • Resolution: Unresolved
    • Fix Version/s: tbd
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      minimal
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      Provide the currency format that provides negative numbers in a locale dependent manner, typically in parentheses.

      Problem

      Negative currency amounts are presented in parentheses for some locales. It's currently not possible to obtain those currency format instances in the JDK.

      Solution

      Use the CLDR that has resources for "accounting" currency format for that purpose. java.text.NumberFormat#getCurrencyInstance(Locale) will return an appropriate format object based on the given locale's "cf" extension.

      Specification

      Insert the following paragraph in java.text.NumberFormat#getCurrencyInstance(Locale) method description:

       * <p>If the specified locale contains the "{@code cf}" (
       * <a href="https://www.unicode.org/reports/tr35/tr35.html#UnicodeCurrencyFormatIdentifier">
       * currency format style</a>)
       * <a href="../util/Locale.html#def_locale_extension">Unicode extension</a>,
       * the returned currency format is based on the specified currency format
       * style. If the currency format for the specified currency format style
       * is not available, or the "{@code cf}" extension is not contained in the
       * specified locale, it defaults to the "{@code standard}" currency format
       * style.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                naoto Naoto Sato
                Reporter:
                naoto Naoto Sato
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: