The Artima Developer Community
Sponsored Link

Java Answers Forum
double without the exponent

1 reply on 1 page. Most recent reply: Oct 14, 2003 11:09 PM by R Black

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
patoots

Posts: 6
Nickname: patoots
Registered: Oct, 2003

double without the exponent Posted: Oct 13, 2003 6:43 PM
Reply to this message Reply
Advertisement
Hi! Have a prob.

What happens is that... when I have a value of

String tempNum = 1234567890.12

...and when i convert the variable (tempNum) to a double:

double doubleNum = Double.parseDouble(tempNum);

the result of doubleNum = 1.23456789012E11.

Just like to ask if there's a possibility that you take away the E(exponent) in a value whose datatype is of double and still get the same value 1234567890.12 which is numeric? Or should I not use double if i want to reach that result?

Thanks! This would be of great help!

patoots


R Black

Posts: 2
Nickname: belwood
Registered: Oct, 2003

Re: double without the exponent Posted: Oct 14, 2003 11:09 PM
Reply to this message Reply
Maybe I just don't see it, but what exactly is the problem you're having with doubleNum? Either way it's represented, it's still the same value for calculation purposes and you can use formatting if you want to print it with the 2 decimal places.

Flat View: This topic has 1 reply on 1 page
Topic: EJB Previous Topic   Next Topic Topic: Popup

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use