Solved

converting string to double

Posted on 2001-09-17
1
201 Views
Last Modified: 2010-03-31
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
             
0
Comment
Question by:clodaghm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
kanthonym earned 50 total points
ID: 6488063
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

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question