I'm using Apache POI to Write a Excel function into a cell and evaluate the function. What i need to do is to remove all decimal points from the cell.Currently it getting unnecessary two Zeros at the end of each cell values.The cell formatting as follows. But it is always getting two zeros at the end.
XSSFCellStyle cellStyle = cell.getCellStyle();
DataFormat df = workbook.createDataFormat();
cellStyle.setDataFormat(df.getFormat("###,##0"));
cell.setCellStyle(cellStyle);
if (cell.getCellType() == Cell.CELL_TYPE_FORMULA) {
evaluator.evaluateFormulaCell(cell);
}
I have refered following URLs and several other sites and couldn't find a way to fix the bug.
NOTE I'm using Apache POI version 3.14 with Spring 4.3.1.RELEASE.