mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
fix issue#IB0EJ9
This commit is contained in:
parent
aa04f420ef
commit
ecf4193280
@ -266,9 +266,9 @@ public class ExcelSaxUtil {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// issue#IB0EJ9 可能精度丢失
|
// issue#IB0EJ9 可能精度丢失,对含有小数的value判断并转为BigDecimal
|
||||||
final double number = Double.parseDouble(value);
|
final double number = Double.parseDouble(value);
|
||||||
if(false == value.equals(Double.toString(number))){
|
if(StrUtil.contains(value, CharUtil.DOT) && !value.equals(Double.toString(number))){
|
||||||
// 精度丢失
|
// 精度丢失
|
||||||
return NumberUtil.toBigDecimal(value);
|
return NumberUtil.toBigDecimal(value);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user