This commit is contained in:
Looly 2022-09-02 22:53:00 +08:00
parent 4a0a977397
commit c5472f839b
2 changed files with 15 additions and 2 deletions

View File

@ -63,8 +63,8 @@ public class StyleSet implements Serializable {
// 默认数字格式
cellStyleForNumber = StyleUtil.cloneCellStyle(workbook, this.cellStyle);
// 2表示0.00
cellStyleForNumber.setDataFormat((short) 2);
// 0表示General
cellStyleForNumber.setDataFormat((short) 0);
// 默认日期格式
this.cellStyleForDate = StyleUtil.cloneCellStyle(workbook, this.cellStyle);

View File

@ -820,6 +820,19 @@ public class ExcelWriteTest {
writer.close();
}
@Test
//@Ignore
public void writeDoubleTest(){
// https://gitee.com/dromara/hutool/issues/I5PI5C
final String path = "d:/test/doubleTest.xlsx";
FileUtil.del(path);
final ExcelWriter writer = ExcelUtil.getWriter(path);
writer.disableDefaultStyle();
writer.writeRow(ListUtil.view(0.427d));
writer.close();
}
@Test
@Ignore
public void issueI466ZZTest(){