toFloat

Parses the string as a Float number and returns the result.

expect fun String.toFloat(): Float(source)
fun main() {
    val numberString = "42.7"
    val numberFloat = numberString.toFloat()
    println("The float value is $numberFloat")
}

Source