I’m taking an EditText input from user like "1/3","1/4" etc. This input must be converted to Double.
This is what I’m trying to do with the code:
double shareDouble= Double.parseDouble(etShare.getText().toString());
But this throws a NumberFormatException. What I’m doing wrong. Please help..
2
Answers
Split the string
Check below function
You have to split string to index 0 and index 1.
And call it in your code like :