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