打表工具支持long类型

back_recharge
lvxinran 2021-05-12 09:54:14 +08:00
parent fbceab8579
commit 39ac72688b
1 changed files with 10 additions and 3 deletions

View File

@ -394,10 +394,17 @@ public class ExcelUtils {
//判断cell类型
switch (cell.getCellType()) {
case Cell.CELL_TYPE_NUMERIC: {
if (cellType != null && cellType.toString().contains("float")){
cellValue = cell.getNumericCellValue();
}else{
if(cellType==null){
cellValue = (int) cell.getNumericCellValue();
}else{
if(cellType.toString().contains("float")){
cellValue = cell.getNumericCellValue();
}else if(cellType.toString().contains("long")){
cellValue = (long)cell.getNumericCellValue();
}else{
cellValue = (int) cell.getNumericCellValue();
}
}
break;
}