This commit is contained in:
Looly
2022-09-22 03:33:30 +08:00
parent d959f3a24f
commit ba5f1f5264
40 changed files with 143 additions and 235 deletions

View File

@@ -1,14 +1,15 @@
package cn.hutool.poi.excel.cell.values;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.text.StrUtil;
import cn.hutool.core.util.CharUtil;
import cn.hutool.poi.excel.ExcelDateUtil;
import cn.hutool.poi.excel.cell.CellValue;
import java.util.Date;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.util.NumberToTextConverter;
import java.util.Date;
/**
* 数字类型单元格值<br>
* 单元格值可能为Long、Double、Date
@@ -48,7 +49,7 @@ public class NumericCellValue implements CellValue<Object> {
final String format = style.getDataFormatString();
// 普通数字
if (null != format && format.indexOf(StrUtil.C_DOT) < 0) {
if (null != format && format.indexOf(CharUtil.DOT) < 0) {
final long longPart = (long) value;
if (((double) longPart) == value) {
// 对于无小数部分的数字类型转为Long