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

Support monetary grouping separator in DecimalFormat/DecimalFormatSymbols

XMLWordPrintable

    • b05
    • generic
    • generic

      ADDITIONAL SYSTEM INFORMATION :
      Win10
      jdk11.0.3


      A DESCRIPTION OF THE PROBLEM :
      The unicode standard defines a currency grouping separator with de_AT (see https://www.unicode.org/cldr/charts/33/by_type/numbers.symbols.html#Symbols_). It is not possible to use the correct grouping separator when dealing with monetary values. For de_AT the monetary grouping separator is a dot '.', the number grouping separator is a blank ' '.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
          public static void main(String[] args) {
              Double number = 1500D;
              NumberFormat format = NumberFormat.getCurrencyInstance(new Locale("de", "AT"));
              String currency = format.format(number);
              System.out.println("Currency in Austria : Must be '€ 1.500,00' but is '" + currency + "'");
          }

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Methods
      - DecimalFormatSymbols.getMonetaryGroupingSeparator()
      - DecimalFormatSymbols.setMonetaryGroupingSeparator(char)
      must exist.
      ACTUAL -
      At the moment the unicode standard for Austria cannot be applied correctly.

      ---------- BEGIN SOURCE ----------
          public static void main(String[] args) {
              Double number = 1500D;
              NumberFormat format = NumberFormat.getCurrencyInstance(new Locale("de", "AT"));
              String currency = format.format(number);
              System.out.println("Currency in Austria : Must be '€ 1.500,00' but is '" + currency + "'");
          }
      ---------- END SOURCE ----------

            naoto Naoto Sato
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: