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.
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.
- duplicates
-
JDK-4738167 [Fmt-Nu] RFE: Indian currency format pattern
- Open