Quantcast
Channel: Java Programming Forum - Learn Java Programming - Apache POI
Viewing all articles
Browse latest Browse all 120

DateFormatter.formatRawCellContents throwing IllegalArgumentException for 0.0 value.

$
0
0
Hi,

I am trying to read a xlsm file with POI

switch (cell.getCachedFormulaResultType()) {

case Cell.CELL_TYPE_NUMERIC:
double value = cell.getNumericCellValue();
int formatIndex = cell.getCellStyle().getDataFormat();
String formatStr = cell.getCellStyle().getDataFormatString();
formatted = dateFormatter.formatRawCellContents(0.0, formatIndex, formatStr);
break;

}

Whenever there is value 0.0 formatRawCellContents api is throwing IllegalArgument Execption.

Any Idea ?

Thanks
Narayan

Viewing all articles
Browse latest Browse all 120

Trending Articles