diff --git a/pom.xml b/pom.xml index d411ade1..9f1a4c72 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.alibaba easyexcel - 2.2.9 + 2.2.10 jar easyexcel diff --git a/src/main/java/com/alibaba/excel/analysis/v07/handlers/AbstractCellValueTagHandler.java b/src/main/java/com/alibaba/excel/analysis/v07/handlers/AbstractCellValueTagHandler.java index f10fa5a4..580e6704 100644 --- a/src/main/java/com/alibaba/excel/analysis/v07/handlers/AbstractCellValueTagHandler.java +++ b/src/main/java/com/alibaba/excel/analysis/v07/handlers/AbstractCellValueTagHandler.java @@ -43,7 +43,7 @@ public abstract class AbstractCellValueTagHandler extends AbstractXlsxTagHandler break; } tempCellData.setType(CellDataTypeEnum.NUMBER); - tempCellData.setNumberValue(new BigDecimal(tempData.toString())); + tempCellData.setNumberValue(BigDecimal.valueOf(Double.parseDouble(tempDataString))); break; default: throw new IllegalStateException("Cannot set values now"); diff --git a/src/test/java/com/alibaba/easyexcel/test/temp/Lock2Test.java b/src/test/java/com/alibaba/easyexcel/test/temp/Lock2Test.java index c3f7ea1b..92202642 100644 --- a/src/test/java/com/alibaba/easyexcel/test/temp/Lock2Test.java +++ b/src/test/java/com/alibaba/easyexcel/test/temp/Lock2Test.java @@ -34,7 +34,7 @@ public class Lock2Test { @Test public void test() throws Exception { // File file = TestFileUtil.readUserHomeFile("test/test6.xls"); - File file = new File("/Users/zhuangjiaju/Downloads/签到金模板-0507-v3.xlsx"); + File file = new File("/Users/zhuangjiaju/test/签到金模板-0507-v5.xlsx"); List list = EasyExcel.read(file).sheet(0).headRowNumber(0).doReadSync(); LOGGER.info("数据:{}", list.size()); diff --git a/src/test/resources/dataformat/dataformat.xls b/src/test/resources/dataformat/dataformat.xls index 5d0d7ff7..c8afd646 100644 Binary files a/src/test/resources/dataformat/dataformat.xls and b/src/test/resources/dataformat/dataformat.xls differ diff --git a/src/test/resources/dataformat/dataformat.xlsx b/src/test/resources/dataformat/dataformat.xlsx index c2070118..f77dd9fd 100644 Binary files a/src/test/resources/dataformat/dataformat.xlsx and b/src/test/resources/dataformat/dataformat.xlsx differ diff --git a/update.md b/update.md index ef085dab..f2d889a4 100644 --- a/update.md +++ b/update.md @@ -1,3 +1,6 @@ +# 2.2.10 +* 修复读取的时候用string接收数字 可能四舍五入不一致的bug + # 2.2.9 * 修复读取的时候用string接收数字 可能四舍五入不一致的bug