File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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: 2
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: 2
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
Marshal

Joined: Mar 22, 2005
Posts: 41108
    
  45
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?


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Losing decimal places when using JXL
 
Similar Threads
Reading date from Excel Spreadsheet
BigDecimal is driving me crazy
JXL: Reading Time Format
finding the empty cell using jxl
if condition in formula in jxl