roundToNearest

fun roundToNearest(value: Int, step: Int): Int

A helper function to round integer value given a step size. For example rounding 40 with step 60 would round up and return 60.


fun roundToNearest(value: Double, step: Double): Double

A helper function to round double value given a step size. For example rounding 1.45 with step 0.1 would round up and return 1.5.