I am using apache poi 3.10-FINAL version to read a couple of cell values and multiply.
I am multiplying two cells, each with value 38.15 & 199.1, but the result is 7595.664999999999 instead of 7595.67
Is there a fix for this?
is = new FileInputStream("V5.xlsx");
XSSFWorkbook wb = new XSSFWorkbook(is);
XSSFDataFormat format = wb.createDataFormat();
XSSFSheet sheet = wb.getSheet("Sample Test");
CreationHelper helper = wb.getCreationHelper();
FormulaEvaluator formulaEval = helper.createFormulaEvaluator();
Cell cell1 = sheet.getRow(2).getCell(1);
Cell cell2 = sheet.getRow(2).getCell(2);
cell1.setCellValue("199.1");
cell2.setCellValue("38.15");
sheet.getRow(2).getCell(3).setCellFormula("B3*C3");
System.out.println(formulaEval.evaluate(sheet.getRow(2).getCell(3)));