I should also add that in this case the cell has a border on it, so that is
why it is showing as cell type numeric and not cell type blank. If I remove
the border it becomes cell type blank.
On Mon, Jun 2, 2008 at 4:16 PM, Murray Waters <[EMAIL PROTECTED]>
wrote:
> Hi,
>
> If i have a cell of type 0 (numeric), how can you distinguish between an
> empty (blank) cell and a zero cell?
>
> public boolean isCellEmpty(HSSFCell cell)
> {
> ...
> if (cell.getCellType() == cell.CELL_TYPE_NUMERIC)
> {
> double doubleVal = cell.getNumericCellValue();
> System.out.println("cell to string is " + cell.toString());
> System.out.println("cell double value is " + doubleVal);
> if (doubleVal == 0.0)
> {
> return true;
> }
> ...
> }
>
> cell.toString() and cell.getNumericCellValue both equal 0.0 in both the
> case when the cell is empty (blank) and when the cell contains '0'.
>
>
> Thanks
>
> Murray
>