It's not a secret anymore!
The moose likes Java in General and the fly likes NullPointerException in GetLastCellNum Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply 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: 32833
    
    4
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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: NullPointerException in GetLastCellNum
 
Similar Threads
Tiles problem with opening response in excel
submitting form data to an excel file
export to excel
complex excel report generation
Export to excel in jsp