percentOf

fun Int.percentOf(total: Int): Double

Returns the percentage that this value represents of total.

For example 25.percentOf(50) is 50.0. Returns 0.0 when total is zero so callers never divide by zero.