converting exponential number to float number

R

ruds

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?
 
P

Patricia Shanahan

ruds said:
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
 
E

Eric Sosman

ruds said:
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.
 
D

Daniel Pitts

Eric said:
If I understand what you are asking for,

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

fills the bill.

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

double d = 1.23e+4;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top