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

Wrong decimal format symbols for pt_PT locale

XMLWordPrintable

      FULL PRODUCT VERSION :
      java 9
      Java(TM) SE Runtime Environment (build 9+181)
      Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Versão 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      Some decimal format symbols are wrong for pt_PT locale. The affected symbols are decimal separator, grouping separator and monetary decimal separator:
      - decimal separator: dollar sign instead of comma
      - grouping separator: comma instead of period
      - monetary decimal separator: dollar sign instead of comma


      REGRESSION. Last worked in version 8u144

      ADDITIONAL REGRESSION INFORMATION:
      java version "1.8.0_144"
      Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
      Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      run System.out.println(DecimalFormat.getInstance(new Locale("pt","PT")).format(1234.5));


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      1.234,5
      ACTUAL -
      1,234$5

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      package decsym;

      import java.text.DecimalFormat;
      import java.util.Locale;

      public class WrongDecimalFormatSymbolsPtPT {

      public static void main(String[] args) {
      System.out.println(DecimalFormat.getInstance(new Locale("pt","PT")).format(1234.5));
      }

      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Do not install java 9

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: