percentOf method

double percentOf(
  1. num total
)

What percent this is of total. 25.percentOf(200) → 12.5

Implementation

double percentOf(num total) => total == 0 ? 0 : this * 100 / total;