提交 6f4d1f64 编写于 作者: L Looly

add test

上级 63b93e02
package cn.hutool.poi.excel;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.poi.excel.style.StyleUtil;
import org.apache.poi.ss.usermodel.BuiltinFormats;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.FillPatternType;
import org.apache.poi.ss.usermodel.Font;
......@@ -507,4 +509,15 @@ public class ExcelWriteTest {
cellStyle.setDataFormat(writer.getWorkbook().createDataFormat().getFormat("yyyy-mm-dd"));
writer.close();
}
@Test
@Ignore
public void writeNumberFormatTest(){
final ExcelWriter writer = ExcelUtil.getWriter("d:/test/formatTest.xlsx");
writer.disableDefaultStyle();
writer.writeRow(ListUtil.toList(51.33333333, 90.111111111));
final CellStyle columnStyle = writer.createCellStyle(0, 0);
columnStyle.setDataFormat((short) BuiltinFormats.getBuiltinFormat("0.00"));
writer.close();
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册