I am using Apache POI to build some excel files and I want to make sure some of the cells are of type "Number".
I tried the followings:
style.setDataFormat(HSSFDataFormat.getBuiltinFormat("0"));
cell.setCellValue(Integer.valueOf(value));
cell.setCellStyle(style);
and
HSSFDataFormat format = workbook.createDataFormat();
style.setDataFormat(format.getFormat("0"));
cell.setCellValue(Integer.valueOf(value));
cell.setCellStyle(style);
where value is a String that I want to display in the cell as Number.
Both approaches work. So, is there a difference between HSSFDataFormat.getBuiltinFormat() and getFormat()?