FULL PRODUCT VERSION :
J2SE 1.4 J2SE 1.5
ADDITIONAL OS VERSION INFORMATION :
windows XP
EXTRA RELEVANT SYSTEM CONFIGURATION :
nothing
A DESCRIPTION OF THE PROBLEM :
DecimalFormat format = new DecimalFormat("#,##0.0#; (#)");
double number2 = -3456.349347;
System.out.println(format.format(number2));
Result expected is: (3,456.35)
But I got : (3,456.35
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the following code, will get wrong result:
DecimalFormat format = new DecimalFormat("#,##0.0#; (#)");
double number2 = -3456.349347;
System.out.println(format.format(number2));
Result expected is: (3,456.35)
But I got : (3,456.35
REPRODUCIBILITY :
This bug can be reproduced always.
J2SE 1.4 J2SE 1.5
ADDITIONAL OS VERSION INFORMATION :
windows XP
EXTRA RELEVANT SYSTEM CONFIGURATION :
nothing
A DESCRIPTION OF THE PROBLEM :
DecimalFormat format = new DecimalFormat("#,##0.0#; (#)");
double number2 = -3456.349347;
System.out.println(format.format(number2));
Result expected is: (3,456.35)
But I got : (3,456.35
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the following code, will get wrong result:
DecimalFormat format = new DecimalFormat("#,##0.0#; (#)");
double number2 = -3456.349347;
System.out.println(format.format(number2));
Result expected is: (3,456.35)
But I got : (3,456.35
REPRODUCIBILITY :
This bug can be reproduced always.
- duplicates
-
JDK-7076409 DecimalFormat.format() truncating output
- Closed
-
JDK-8044849 DecimalFormat looses closing parenthesis when using (#) as negative subpattern
- Closed
-
JDK-8072449 Javadoc of java.text.DecimalFormat is wrong
- Closed
-
JDK-4395163 [Fmt-Nu] Negative suffix ignored if negative subpattern doesn't match positive subpattern
- Closed
- relates to
-
JDK-8180188 DecimalFormat not throwing any exception for invalid pattern
- Closed
-
JDK-6609682 [Fmt-De] DecimalFormat constructor imposes default negative prefix when none specified
- Closed
(1 relates to)