解决 ExcelImport 数值类型为负数的时候小数问题

This commit is contained in:
thinkgem
2025-09-13 16:01:37 +08:00
parent 69011d80a4
commit c06f2e4ff1

View File

@@ -305,7 +305,7 @@ public class ExcelImport implements Closeable {
if (DateUtil.isCellDateFormatted(cell)) {
val = DateUtil.getJavaDate((Double) val); // POI Excel 日期格式转换
}else{
if ((Double) val % 1 > 0){
if (Math.abs((double)val % 1) > 1E-10){
val = new DecimalFormat("0.00").format(val);
}else{
val = new DecimalFormat("0").format(val);