I assume you want to convert String to float or double?
String input = "3.14"; float x = Float.parseFloat(input);
This code converts the string "3.14" to a float. You can use this float in the function described by you in the question.
EDIT: If you want to convert the full String function to Java code, you must restrict the input to buttons. For example, add a button called "Cos" and remember, in the code the user wants to use the Cosinus function. Then the user enters a value and presses "Enter". The code knows that it must use the cosinus function, and x is the value entered in EditText. This value should be parsed using Float.parseFloat ().
fifarunnerr Jan 15 '14 at 13:02 2014-01-15 13:02
source share