How to covert String("6,400.0") to Double ?

G

Guest

public static double removePeriod(String format) {
double a = 23.0;
format = "23.0";
a = Double.parseDouble(format,10);
return a;
}
 
T

Thomas Weidenfeller

public static double removePeriod(String format) {
double a = 23.0;
format = "23.0";
a = Double.parseDouble(format,10);
return a;
}

Is that supposed to be a question?

May I recommend that you read

http://www.yoda.arachsys.com/java/newsgroups.html

and
http://www.catb.org/~esr/faqs/smart-questions.html

particular

http://www.catb.org/~esr/faqs/smart-questions.html#beprecise

and follow that advice prior to posting?

You might also want to consider posting to comp.lang.java.help instead.
But also, read and follow the above advice before posting here ore there.

/Thomas
 
R

Roedy Green

G

Guest

test_double.java:10: Method parseDouble(java.lang.String) not found in class
jav
a.lang.Double.
t = Double.parseDouble("-12000.001");

Compile error on java version "1.1.3". it is ok on java version
 
A

Andrew Thompson

test_double.java:10: Method parseDouble(java.lang.String) not found in class
jav
a.lang.Double.
t = Double.parseDouble("-12000.001");

Compile error on java version "1.1.3".

Yes. Double.parseDouble(String) was introduced in 1.2.

Where on Earth did you get a 1.1.3 SDK from?

( And why on Earth are you *using* it? )
 

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,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top