Android Studio – String cannot be cast to Float – Kotlin
val nextDigit = passedList[i + 1] as Float I'm trying cast this and It's giving that error. I tried with .toFloat() but It doesn't work.. Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Float at com.example.calculator.MainActivity.calcTimesDiv(MainActivity.kt:108)