Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Losing decimal places when using JXL

 
surendar prabu
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • 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.
 
Allan Sy
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • 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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic