• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Losing decimal places when using JXL

 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am trying to read an excel sheet using the JXL API. When reading a cell with float/double values, the is returning only 3 decimal places. i.e; I get 0.169 in place of 0.16945.
Help me on how I can read the exact number in the cell.

Regards,
Surendar.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am having the same problem. It always rounds to 3 decimal places for number. I need this because I am dealing with foreign exchange rates and it should not be rounded off.

Can anybody help?

Thanks!
 
Allan Sy
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check this one out.

http://www.andykhan.com/jexcelapi/tutorial.html#reading

But I'm still having problems because 0.000109 has been converted to 1.09E-4.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Allan Sy wrote:But I'm still having problems because 0.000109 has been converted to 1.09E-4.


That's the same number, just displayed differently. Have you tried a different cell format?
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try this :

((NumberCell)cell).getValue()

This returns Double value and all the decimal points.

Thanks,
Surodip
 
money grubbing section goes here:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic