Using Apache POI, I am trying to process a large amount of numeric data. I am checking for the cell type, for instance
case HSSFCell.CELL_TYPE_NUMERIC:
value = String.valueOf(cell.getNumericCellValue());
break;
Is there a way I can determine what type of numeric value t开发者_如何学JAVAhe cell holds? For instance, how do I know that it is safe to cast the return value to a non-floating point value?
getNumericCellValue returns double for all the numeric cells. You can check values like this:
if( Math.floor(d) == d ) {
...
}
精彩评论