• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

NullPointerException in GetLastCellNum

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Marshal
Posts: 76811
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic