Skip to content

Commit 408235a

Browse files
committed
DF fix for very small numbers
1 parent fc5f556 commit 408235a

5 files changed

Lines changed: 3 additions & 3 deletions

File tree

3 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20260110113922
1+
20260408220821
3 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20260110113922
1+
20260408220821

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public static String formatDecimal(double value, int decimalDigits) {
125125
return (isNeg ? "-" : "") + s1 + formattingStrings[decimalDigits].substring(1);
126126
int pt1 = s1.indexOf("E-");
127127
if (pt1 > 0) {
128-
n = PT.parseInt(s1.substring(pt1 + 1));
128+
n = Math.max(-40, PT.parseInt(s1.substring(pt1 + 1)));
129129
// 3.567E-2
130130
// 0.03567
131131
// -0.0001

0 commit comments

Comments
 (0)