File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
core/src/main/java/com/alibaba/fastjson2 Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -3093,10 +3093,14 @@ public final Number getNumber() {
3093
3093
}
3094
3094
}
3095
3095
3096
- if (exponent != 0 && ( context . features & ( Feature . UseBigDecimalForDoubles . mask | Feature . UseBigDecimalForFloats . mask )) == 0 ) {
3096
+ if (exponent != 0 ) {
3097
3097
String decimalStr = decimal .toPlainString ();
3098
- return Double .parseDouble (
3099
- decimalStr + "E" + exponent );
3098
+ if ((context .features & (Feature .UseBigDecimalForDoubles .mask | Feature .UseBigDecimalForFloats .mask )) == 0 ) {
3099
+ return Double .parseDouble (
3100
+ decimalStr + "E" + exponent );
3101
+ } else {
3102
+ return new BigDecimal (decimalStr + "E" + exponent );
3103
+ }
3100
3104
}
3101
3105
3102
3106
if ((context .features & Feature .UseDoubleForDecimals .mask ) != 0 ) {
You can’t perform that action at this time.
0 commit comments