https://issues.apache.org/bugzilla/show_bug.cgi?id=54786
--- Comment #3 from Dominik Stadler <[email protected]> --- Created attachment 30146 --> https://issues.apache.org/bugzilla/attachment.cgi?id=30146&action=edit Sample Excel file having formatting using doulbe quotes as escape characters The attached file shows the conditional date formatting using TEXT() with two double quotes as escape characters. I.e. cell A1 contains the formula =TEXT(B1; "[h]""h"" m""m""") In Excel, this formats Cell B1 the number of hours with a trailing "h" and the number of minutes with a trailing "m". If I calculate this formula with POI, I get 0"0" 15"15", i.e. h and m are replaced twice with hours/minutes and one of the two double-quotes are removed. The following unit test fails with the attached file, but I would expect it to work fine: @Test public void test() throws IOException { InputStream inp = new FileInputStream(new File("testsrc/test.xlsx")); final Workbook wb; try { wb = new XSSFWorkbook(inp); } finally { inp.close(); } Sheet sheet = wb.getSheetAt(0); assertNotNull(sheet); Row row = sheet.getRow(0); assertNotNull(row); Cell cell = row.getCell(0); assertNotNull(cell); FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator(); CellValue cellValue = evaluator.evaluate(cell); assertEquals(Cell.CELL_TYPE_STRING, cellValue.getCellType()); String stringValue = cellValue.getStringValue(); assertEquals("0h 15m", stringValue); } -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
