convert string to float in android
You are using a comma when you should be using a period
float f1 = Float.parseFloat("1.9698");
That should work.
You have added comma instead of '.'
Do like this.
float f1 = Float.parseFloat("1.9698");
Hope this will help you..
Float number;
String str=e1.getText().toString();
number = Float.parseFloat(str);
Or In one line-
float float_no = Float.parseFloat("3.1427");