I have a numeric cell with formula =CB11*$CA11
which displays in Excel as 22631.58. But when I do a vlookup I get the value as 22631.58044
I need to fetch actual value of 22631.58044 but I get 22631.58 using this code with XSSFWorkbook
.
DataFormatter dataFormatter = new DataFormatter();
dataFormatter.setUseCachedValuesForFormulaCells(true);
for(int cn=row.getFirstCellNum(); cn<row.getLastCellNum(); cn++) {
Cell cell = row.getCell(cn, Row.MissingCellPolicy.CREATE_NULL_AS_BLANK);
String value = dataFormatter.formatCellValue(cell);