Browse Source

Bug 57236: Add reproducer, although I am not sure if we should and how to fix this...

pull/80/head
antony-liu 10 years ago
parent
commit
214f964bd4
  1. 34
      testcases/ooxml/XSSF/UserModel/TestUnfixedBugs.cs

34
testcases/ooxml/XSSF/UserModel/TestUnfixedBugs.cs

@ -85,7 +85,39 @@ namespace NPOI.XSSF.UserModel
}
}
}
[Test]
public void Test57236()
{
// Having very small numbers leads to different formatting, Excel uses the scientific notation, but POI leads to "0"
/*
DecimalFormat format = new DecimalFormat("#.##########", new DecimalFormatSymbols(Locale.Default));
double d = 3.0E-104;
Assert.AreEqual("3.0E-104", format.Format(d));
*/
DataFormatter formatter = new DataFormatter(true);
XSSFWorkbook wb = XSSFTestDataSamples.OpenSampleWorkbook("57236.xlsx");
for (int sheetNum = 0; sheetNum < wb.NumberOfSheets; sheetNum++)
{
ISheet sheet = wb.GetSheetAt(sheetNum);
for (int rowNum = sheet.FirstRowNum; rowNum < sheet.LastRowNum; rowNum++)
{
IRow row = sheet.GetRow(rowNum);
for (int cellNum = row.FirstCellNum; cellNum < row.LastCellNum; cellNum++)
{
ICell cell = row.GetCell(cellNum);
String fmtCellValue = formatter.FormatCellValue(cell);
//System.out.Println("Cell: " + fmtCellValue);
Assert.IsNotNull(fmtCellValue);
Assert.IsFalse(fmtCellValue.Equals("0"));
}
}
}
}
}
}
Loading…
Cancel
Save