• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NullPointerException in GetLastCellNum

 
puff li
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 49841
70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic