converting string to double

hi,

I know that you can convert a string to an integer by

int q_no;
String q_string = "4";

q_no = Integer.parseInt(q_string);

but I want to convert a string to a double. Any suggestions?

Thanks
Clo
             
clodaghmAsked:
Who is Participating?
 
kanthonymConnect With a Mentor Commented:
static Double valueOf(String s)
          Returns a new Double object initialized to the value represented by the specified string.


Double myNum = Double.valueOf( "stringvalue of number" )
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.