getFraction

fun <T : Number> getFraction(part: T, whole: T): Double

Helper function to convert a part amount of a whole into a fraction. The returned range is [0.0, 1.0], making it suitable for UI elements (such as progress bars) requiring such value intervals.