-
Bug
-
Resolution: Fixed
-
P3
-
8, 9
-
b139
-
generic
-
generic
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8196278 | 8u191 | Nishit Jain | P3 | Resolved | Fixed | b01 |
JDK-8201080 | 8u181 | Unassigned | P3 | Resolved | Fixed | b01 |
JDK-8186499 | 8u172 | Ramanand Patil | P3 | Resolved | Fixed | b01 |
JDK-8203127 | emb-8u181 | Nishit Jain | P3 | Resolved | Fixed | master |
FULL PRODUCT VERSION :
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Windows Server 2012, OSX
A DESCRIPTION OF THE PROBLEM :
Multiple calls to DecimalFormat when formatting percentages can lead to extra % in the output
REGRESSION. Last worked in version 7u80
ADDITIONAL REGRESSION INFORMATION:
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
0.006%
0%
0.006%
ACTUAL -
0.006%
0%
0%006%
REPRODUCIBILITY :
This bug can be reproduced occasionally.
---------- BEGIN SOURCE ----------
import java.text.*;
public class DecFormats {
public static void main(String[] args) {
DecimalFormat nf = (DecimalFormat) DecimalFormat.getPercentInstance(new java.util.Locale("en_US"));
nf.setMaximumFractionDigits(3);
nf.setMinimumFractionDigits(0);
nf.setMultiplier(1);
System.out.println(nf.format(.005678));
System.out.println(nf.format(0.0));
System.out.println(nf.format(.005678));
}
}
---------- END SOURCE ----------
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Windows Server 2012, OSX
A DESCRIPTION OF THE PROBLEM :
Multiple calls to DecimalFormat when formatting percentages can lead to extra % in the output
REGRESSION. Last worked in version 7u80
ADDITIONAL REGRESSION INFORMATION:
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
0.006%
0%
0.006%
ACTUAL -
0.006%
0%
0%006%
REPRODUCIBILITY :
This bug can be reproduced occasionally.
---------- BEGIN SOURCE ----------
import java.text.*;
public class DecFormats {
public static void main(String[] args) {
DecimalFormat nf = (DecimalFormat) DecimalFormat.getPercentInstance(new java.util.Locale("en_US"));
nf.setMaximumFractionDigits(3);
nf.setMinimumFractionDigits(0);
nf.setMultiplier(1);
System.out.println(nf.format(.005678));
System.out.println(nf.format(0.0));
System.out.println(nf.format(.005678));
}
}
---------- END SOURCE ----------
- backported by
-
JDK-8186499 DecimalFormat percentage format can contain unexpected %
-
- Resolved
-
-
JDK-8196278 DecimalFormat percentage format can contain unexpected %
-
- Resolved
-
-
JDK-8201080 DecimalFormat percentage format can contain unexpected %
-
- Resolved
-
-
JDK-8203127 DecimalFormat percentage format can contain unexpected %
-
- Resolved
-
- duplicates
-
JDK-8193920 Decimal format with positive suffix breaks after formatting zero
-
- Closed
-
-
JDK-8186431 DecimalFormat suffix stomps decimal separator when fraction pattern is optional
-
- Closed
-
(1 duplicates)