*
The moose likes Java in General and the fly likes NullPointerException in GetLastCellNum Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "NullPointerException in GetLastCellNum" Watch "NullPointerException in GetLastCellNum" New topic
Author

NullPointerException in GetLastCellNum

puff li
Greenhorn

Joined: Jul 28, 2010
Posts: 22
Hi,

I am using Apache POI to access MS Excel. I am an 5 * 10 Excel data. But the getLastRowNum() method returns 19... and in the 6th row the method getLastCellNum() method returns 3.. and NullPointerException.

Also, if there data is a number, say 15, if I use getCellValue().toString(), it will display 15.00. If I change the cell type to string type, if I use getStringCellValue, if the data is 27.95, it will display some weird value like 27.9500034..


What is wrong??? Thanks.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39828
    
  28
puff li wrote: . . . if the data is 27.95, it will display some weird value like 27.9500034..


What is wrong??? Thanks.
Nothing. That is normal behaviour for floating-point numbers (see No 20).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NullPointerException in GetLastCellNum