percentage

fun <T> Collection<T>.percentage(predicate: (T) -> Boolean): Float

Returns how many percent of the items of the given Collection satisfy the predicate.

Return

A percentage represented as a floating-point number between 0 and 1