I'm making a calculator app and I need a way to convert a String (the numbers that the user click that appear on the display) into a double. For example this is a String:
String stringNumber="12.5/2.4+12";
And I need to put this expression into a double and calculate the result.
I have tried in this way:
double number= Double.parseDouble(stringNumber);
But obviously it doesn't work. It's because there are signs inside the expression. I need to calculate the result before the assignment.