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

Support monetary grouping separator in DecimalFormat/DecimalFormatSymbols

    Details

    • Subcomponent:
    • Resolved In Build:
      b05
    • CPU:
      generic
    • OS:
      generic

      Description

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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: