Julie
0
Q:

string to double java

public class stringtodouble {
	public static void main(String args) {
    	String string = "1.23";
      	double decimal = Double.parseDouble(string);
    }
}
4
try {
  a = Double.parseDouble(b);
} catch (NumberFormatException e) {
  //the parseDouble failed and you need to handle it here
}
2
Double d = Double.valueOf(String str);
10
Double myDouble = Double.parseDouble("23.5");
1
double number = -895.25;
String numberAsString = String.valueOf(number);
5

New to Communities?

Join the community