<<< Integer.parseInt | Index | Double.parseDouble >>> |
To convert a String consisting of a decimal number to a value of the type float, we use the following expression:
Float.parseFloat(strExpression)
For example,
Float.parseFloat("34.56") = 34.56 Float.parseFloat("-542.97") = -542.97
parseFloat is a method of the class Float and is used to convert a numeric decimal string into an equivalent value of the type float
<<< Integer.parseInt | Index | Double.parseDouble >>> |