convertRange

fun Float.convertRange(srcMin: Float, srcMax: Float, dstMin: Float, dstMax: Float): Float
fun Double.convertRange(srcMin: Double, srcMax: Double, dstMin: Double, dstMax: Double): Double
fun Int.convertRange(srcMin: Int, srcMax: Int, dstMin: Int, dstMax: Int): Int
fun Long.convertRange(srcMin: Long, srcMax: Long, dstMin: Long, dstMax: Long): Long

Converts this value considering it was in the range srcMin..srcMax into dstMin..dstMax, if the value is not inside the range the output value will be outside the destination range