This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes Losing decimal places when using JXL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Losing decimal places when using JXL" Watch "Losing decimal places when using JXL" New topic
Author

Losing decimal places when using JXL

surendar prabu
Ranch Hand

Joined: Jul 24, 2006
Posts: 102
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.


SCJP 1.4
Allan Sy
Greenhorn

Joined: Jan 26, 2011
Posts: 4
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

Joined: Jan 26, 2011
Posts: 4
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.
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
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?
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Losing decimal places when using JXL
 
It's not a secret anymore!