Commit 33793d8eff54f65c7837b2f82bc849ca2ffa6e0c
1 parent
96529069
Excel导出类型NUMERIC支持精度浮点类型
Showing
1 changed file
with
1 additions
and
1 deletions
ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
| @@ -503,7 +503,7 @@ public class ExcelUtil<T> | @@ -503,7 +503,7 @@ public class ExcelUtil<T> | ||
| 503 | else if (ColumnType.NUMERIC == attr.cellType()) | 503 | else if (ColumnType.NUMERIC == attr.cellType()) |
| 504 | { | 504 | { |
| 505 | cell.setCellType(CellType.NUMERIC); | 505 | cell.setCellType(CellType.NUMERIC); |
| 506 | - cell.setCellValue(Integer.parseInt(value + "")); | 506 | + cell.setCellValue(StringUtils.contains(Convert.toStr(value), ".") ? Convert.toDouble(value) : Convert.toInt(value)); |
| 507 | } | 507 | } |
| 508 | } | 508 | } |
| 509 | 509 |