We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d44e4a4 commit 9c1cd83Copy full SHA for 9c1cd83
core/src/main/java/com/alibaba/fastjson2/JSONReader.java
@@ -3093,10 +3093,14 @@ public final Number getNumber() {
3093
}
3094
3095
3096
- if (exponent != 0 && (context.features & (Feature.UseBigDecimalForDoubles.mask | Feature.UseBigDecimalForFloats.mask)) == 0) {
+ if (exponent != 0) {
3097
String decimalStr = decimal.toPlainString();
3098
- return Double.parseDouble(
3099
- decimalStr + "E" + exponent);
+ if ((context.features & (Feature.UseBigDecimalForDoubles.mask | Feature.UseBigDecimalForFloats.mask)) == 0) {
+ return Double.parseDouble(
3100
+ decimalStr + "E" + exponent);
3101
+ } else {
3102
+ return new BigDecimal(decimalStr + "E" + exponent);
3103
+ }
3104
3105
3106
if ((context.features & Feature.UseDoubleForDecimals.mask) != 0) {
0 commit comments