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

Decimal form is inconsistent between CLDR and Java in some special locales

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 10
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b12
    • Verification:
      Verified

      Description

      Steps:
      Tests number format consistency between CLDR and Java, using 0.56 as input.
      For example: on locale pt_PT. The pattern of decimalFormat is "#.##0,###" (group is "." and decimal is ",") in CLDR pt.xml file.
      To compare the output format between CLDR and Java, by running below code.

      public void javaNumberOutput() {
          String a="0.56";
          Locale target = Locale.forLanguageTag("pt-PT");

          double d = Double.valueOf(a).doubleValue();
          String outString = NumberFormat.getNumberInstance(target).format(d);
          System.out.println("expected:" + outString);
      }

      Result:
      Following CLDR decimalFormat, the output should be 0,56, but actually the output of below code is 0$56.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rgoel Rachna Goel (Inactive)
                Reporter:
                yzhou Daisy Zhou
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: