Answers for "kotlin round float to double"

3

Kotlin round double string

val number = 10.7086134
val rounded = String.format("%.3f", number) // rounds to 3 decimal places
Posted by: Guest on May-09-2020
1

rounding in kotlin double to int

val a : Double = 3.45
val b : Int = a.roundToInt()
Posted by: Guest on February-01-2022

Browse Popular Code Answers by Language