valueToPercentOfRange

fun Float.valueToPercentOfRange(min: Float = 0.0f, max: Float): Float

Calculates the percentage of a value in a given range.

Return

Percentage of a given value in a range. If within range, returned values are between 0f,1f

Parameters

value

Input value.

min
  • Min Range Value.

max
  • Max Range Value.