We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Getting Exponential values when insertinbg to database

anna_1980
anna_1980 asked
on
Medium Priority
362 Views
Last Modified: 2010-08-05
I am using JSP deployed on Tomcat with Oracle 8i as database. My problem is when i insert a large value(say 10 digits)  using JSP in my database it gets inserted as something like 4.8E9
I am usin Double datatype in JSP and the width of column in Oracle is also defined as NUMBER(20,2).
Comment
Watch Question

Commented:
What are you using to view the Oracle values?  Have you tried reading the values back out of Oracle using JDBC?
Basic question, is this actually a problem, or is it just the appearance of the number that concerns you?

Commented:
Try using Float.
Javier
follow what other experts have suggested. if you have problem on displaying value in web page, then your might also want to look into java.text.DecimalFormat

Author

Commented:
>>What are you using to view the Oracle values?  Have you tried reading the values back out of Oracle using JDBC?
Basic question, is this actually a problem, or is it just the appearance of the number that concerns you?

--Yes, I am using JDBC and fetching the values back using ResultSet.  
This is indeed a problem because users don't like it that way.


>>Try using Float.

--Tried that.Infact I started with using Float but then switched to Double thinking it may solve the problem.



Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Commented:
Can you post you code to see if is something starnge on it?
Javier

Author

Commented:
Thanks everyone for helping

Commented:
Gotta acknowledge kennethxu's expreience here; avoiding the trap of taking the problem description as gospel, seeing through it, and solving the actual problem... (presentation of numbers on screen, NOT in the database)

Commented:
Doesn't he got the Points??

:c)

Javier

P.D.: I agree Searlas.
you guys are making fun on me :-)
I would like to pass some points but just afraid somebody in the forum will again starts crying. Missing those days that can enjoy a peaceful forum with you guys.

Commented:
Hmm as I see it, points mean nothing here* , well is good that EE has given us unlimited points to ask I appeciate that even while I don't ask much, but what I really miss is a place to talk and get to know each other a bit better.

I really enjoy helping ppl here and that's becose we can make a laugh from time to time :c))

Javier

* To tell the truth I like to see my name on the list :cP
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.