convert string to double in android

w‮al.ww‬utturi.com
convert string to double in android
Double dnum;
String str = "3.1415";
try {
	dnum = Double.parseDouble(str);
}catch (NumberFormatException e) {
	//the string does not contain valid double value
}

android string to double

String s = "3.1415";
DecimalFormat dF = new DecimalFormat("0.00");
Number num = dF.parse(s);
double final = num.doubleValue();
Created Time:2017-08-31 07:37:19  Author:lautturi