How to convert an Integer
or a String
number to a float
number like this "1"
to 1.0f
(or 1f
). I tried most of all codes, but all time I get the same. But, I need to get 1f
.
val num = 1
val b = num.toFloat()
Log.i("b",b.toString())
Result is 1.0
.