Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > converting exponential number to float number

Reply
Thread Tools

converting exponential number to float number

 
 
ruds
Guest
Posts: n/a
 
      01-10-2007
Can anyone tell me how do i convert a string contianing exponential
number to decimal/float number?
Is there any built in method for doing this?

 
Reply With Quote
 
 
 
 
Patricia Shanahan
Guest
Posts: n/a
 
      01-10-2007
ruds wrote:
> Can anyone tell me how do i convert a string contianing exponential
> number to decimal/float number?
> Is there any built in method for doing this?
>


Can you give an example of a string you want to convert?

Patricia
 
Reply With Quote
 
 
 
 
Eric Sosman
Guest
Posts: n/a
 
      01-10-2007
ruds wrote:
> Can anyone tell me how do i convert a string contianing exponential
> number to decimal/float number?
> Is there any built in method for doing this?


If I understand what you are asking for,

double d = Double.parseDouble("1.23e+4");

fills the bill.

--
Eric Sosman
lid

 
Reply With Quote
 
Daniel Pitts
Guest
Posts: n/a
 
      01-10-2007

Eric Sosman wrote:
> ruds wrote:
> > Can anyone tell me how do i convert a string contianing exponential
> > number to decimal/float number?
> > Is there any built in method for doing this?

>
> If I understand what you are asking for,
>
> double d = Double.parseDouble("1.23e+4");
>
> fills the bill.
>
> --
> Eric Sosman
> lid


Or, if its a constant string, why bother parsing at all?

double d = 1.23e+4;

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
float to string to float, with first float == second float Carsten Fuchs C++ 45 10-08-2009 09:47 AM
exponential float formmating zunbeltz@gmail.com Python 6 09-08-2007 05:38 AM
converting double number to exponential number sweetone Java 1 01-20-2007 07:59 AM
converting exponential format number to decimal format number Fei Liu Perl Misc 21 12-16-2006 01:49 AM
Re: float->byte->float is same with original float image. why float->ubyte->float is different??? bd C Programming 0 07-07-2003 12:09 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57