Skip to content

Commit 682511a

Browse files
committed
DecimalFormat fix for missing minus sign
1 parent 9f2f64c commit 682511a

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20210923060334
1+
20211009053211
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20210923060334
1+
20211009053211

sources/net.sf.j2s.java.core/src/javajs/util/DF.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ public static String formatDecimal(float value, int decimalDigits) {
137137
int pt2 = decimalDigits + pt + 1;
138138
if (pt2 < len && s1.charAt(pt2) >= '5') {
139139
return formatDecimal(
140-
value + (isNeg ? -1 : 1) * formatAdds[decimalDigits], decimalDigits);
140+
(isNeg ? -1 : 1) * (value + formatAdds[decimalDigits]),
141+
decimalDigits);
141142
}
142143

143144
String s0 = s1.substring(0, (decimalDigits == 0 ? pt

0 commit comments

Comments
 (0)