POI Excel HSSFCell number format setting unit

In the report system encounters a problem and needs to set the digital format, because the default text, numeric format manually brush, to solve the following code:

// HeCG95
// (1)设置 HSSFCell 为数值类型,如果传入字符串,后面一步设置格式也失效的
HSSFCell.setCellValue(Float.parseFloat(value));
// (2)设置样式
HSSFCellStyle.setDataFormat(HSSFDataFormat.getBuiltinFormat("0.00"));

Guess you like

Origin www.cnblogs.com/HeCG95/p/12457391.html