Browse Source

Excel导出类型NUMERIC支持精度浮点类型

tags/v2.2
RuoYi 4 years ago
parent
commit
155b585ae5
  1. 2
      ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java

2
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java

@ -494,7 +494,7 @@ public class ExcelUtil<T> @@ -494,7 +494,7 @@ public class ExcelUtil<T>
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));
}
}

Loading…
Cancel
Save