From 33793d8eff54f65c7837b2f82bc849ca2ffa6e0c Mon Sep 17 00:00:00 2001 From: RuoYi Date: Wed, 9 Sep 2020 11:30:34 +0800 Subject: [PATCH] =?UTF-8?q?Excel=E5=AF=BC=E5=87=BA=E7=B1=BB=E5=9E=8BNUMERI?= =?UTF-8?q?C=E6=94=AF=E6=8C=81=E7=B2=BE=E5=BA=A6=E6=B5=AE=E7=82=B9?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java index 4e93c6c..43e52da 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java @@ -503,7 +503,7 @@ public class ExcelUtil else if (ColumnType.NUMERIC == attr.cellType()) { cell.setCellType(CellType.NUMERIC); - cell.setCellValue(Integer.parseInt(value + "")); + cell.setCellValue(StringUtils.contains(Convert.toStr(value), ".") ? Convert.toDouble(value) : Convert.toInt(value)); } }