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

Pattern not correctly resolved by DecimalFormat(String pattern) for Nepali

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 5.0
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_xp

      Description

      FULL PRODUCT VERSION :
      java version "1.5.0_01"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)
      Java HotSpot(TM) Client VM (build 1.5.0_01-b08, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      Format recognized by both DecimalFormat and NumberFormat works correctly for most of locales. Where the group length is constant. For example : xxx,xxx,xxx.xx

      In Nepali numeric system such grouping is done

      XX,XX,XXX.XXX

      Last integer is grouped with length 3 and others with length 2.
      12,12,123.00.



      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      package a;

      import java.text.DecimalFormat;

      public class ABCD {
          public static void main(String[] args) {
              DecimalFormat decimalFormat = new DecimalFormat("##,##,###.##");
              String myString = decimalFormat.format(1111111111.1111d);
              System.out.println("Real : " + myString);
              System.out.println("Expected : " + "1,11,11,11,111.11");
          }
      }

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      1,11,11,11,111.11
      ACTUAL -
      1,111,111,111.11

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      Ref: Steps to Reproduce
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Parsing the number manually.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              peytoia Yuka Kamiya (Inactive)
              Reporter:
              okutsu Masayoshi Okutsu
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: