• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getDouble() not returning correct data

 
Jennifer Sohl
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I have a column in a table that has data that is defined as Numeric(6,4).
In my java app, all I am trying to do is print this data to std out. When I get the information from the db, I do a getDouble() to retrieve it, and I am getting a result of 1.0E-4 ?? The actual value in the db is .0001. Why isn't this returning .0001?
If I run the SQL statement and don't go through the app, it returns .0001.
What am I doing wrong?
Thanks for any help.
 
Matthew Vincent
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just use the following code snippet to help you. Assuming that your variable is called myVal...

Matt
 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just for the record, 1.0E-4 is .0001, in case anyone missed that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic