diff --git a/src/net/tccn/kit/poi/ExcelKit.java b/src/net/tccn/kit/poi/ExcelKit.java index 0071495..7e8dbae 100644 --- a/src/net/tccn/kit/poi/ExcelKit.java +++ b/src/net/tccn/kit/poi/ExcelKit.java @@ -1,7 +1,6 @@ package net.tccn.kit.poi; import org.apache.poi.poifs.filesystem.OfficeXmlFileException; -import org.apache.poi.ss.formula.functions.T; import org.apache.poi.ss.usermodel.*; import org.apache.poi.xssf.streaming.SXSSFWorkbook; @@ -304,7 +303,8 @@ public class ExcelKit { } if (cell.getCellType() == CellType.NUMERIC) { - map.put(fields[j], cell.getNumericCellValue() + ""); + double v = cell.getNumericCellValue(); + map.put(fields[j], (v%1 == 0 ? (long)v : v + "")); } else { map.put(fields[j], cell.getStringCellValue()); } @@ -346,7 +346,8 @@ public class ExcelKit { } if (cell.getCellType() == CellType.NUMERIC) { - map.put(field, cell.getNumericCellValue() + ""); + double v = cell.getNumericCellValue(); + map.put(field, (v%1 == 0 ? (long)v : v + "")); } else { map.put(field, cell.getStringCellValue()); }