Skip to content

Commit 1a9edee

Browse files
committed
DF.formatDecimal fix for -n
exponential, should be total # sig digits.
1 parent b376c04 commit 1a9edee

File tree

1 file changed

+2
-2
lines changed
  • sources/net.sf.j2s.java.core/src/javajs/util

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public static String formatDecimal(double value, int decimalDigits) {
8585
value = -value;
8686
int n;
8787
if (decimalDigits < 0) {
88-
decimalDigits = -1-decimalDigits;
88+
decimalDigits = -decimalDigits;
8989
if (decimalDigits > formattingStrings.length)
9090
decimalDigits = formattingStrings.length;
9191
if (value == 0)
@@ -103,7 +103,7 @@ public static String formatDecimal(double value, int decimalDigits) {
103103
String s = ("" + d).toUpperCase();
104104
int i1 = s.indexOf("E");
105105
String sf;
106-
if (i1 < 0) {
106+
if (i1 < 0) {
107107
sf = "" + value;
108108
} else {
109109
n = PT.parseInt(s.substring(i1 + (s.indexOf("E+") == i1 ? 2 : 1))) + n;

0 commit comments

Comments
 (0)