|
@@ -26,7 +26,6 @@ import java.text.NumberFormat;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.Map.Entry;
|
|
|
-import java.util.regex.Pattern;
|
|
|
|
|
|
/**
|
|
|
* Excel导入导出工具类
|
|
@@ -369,13 +368,19 @@ public class ExcelUtils {
|
|
|
}
|
|
|
// 数字类型
|
|
|
if (cell.getCellTypeEnum() == CellType.NUMERIC) {
|
|
|
- String s = cell.getNumericCellValue() + "";
|
|
|
+
|
|
|
+ DataFormatter formatter = new DataFormatter();
|
|
|
+ String s = formatter.formatCellValue(cell);
|
|
|
+
|
|
|
+ return s;
|
|
|
+
|
|
|
+ /*String s = cell.getNumericCellValue() + "";
|
|
|
// 去掉尾巴上的小数点0
|
|
|
if (Pattern.matches(".*\\.0*", s)) {
|
|
|
return s.split("\\.")[0];
|
|
|
} else {
|
|
|
return s;
|
|
|
- }
|
|
|
+ }*/
|
|
|
}
|
|
|
// 布尔值类型
|
|
|
if (cell.getCellTypeEnum() == CellType.BOOLEAN) {
|