Calculates what percentage value is of total. Returns 0 if total is 0.
value
total
0
The partial value.
The total value.
percentageOf(25, 100) // => 25percentageOf(1, 4) // => 25percentageOf(5, 0) // => 0 Copy
percentageOf(25, 100) // => 25percentageOf(1, 4) // => 25percentageOf(5, 0) // => 0
Calculates what percentage
valueis oftotal. Returns0iftotalis0.