Skip to content

Commit cf057cd

Browse files
committed
fix Issue2866.test:18 expected: <0> but was: <0E-18>
1 parent 6714afb commit cf057cd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/java/com/alibaba/fastjson2/JSONReader.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -3099,7 +3099,7 @@ public final Number getNumber() {
30993099
return Double.parseDouble(
31003100
decimalStr + "E" + exponent);
31013101
}
3102-
return new BigDecimal(decimalStr + "E" + exponent);
3102+
return decimal.signum() == 0 ? BigDecimal.ZERO : new BigDecimal(decimalStr + "E" + exponent);
31033103
}
31043104

31053105
if ((context.features & Feature.UseDoubleForDecimals.mask) != 0) {

0 commit comments

Comments
 (0)