| Problem | Method of Math.percent
|
|---|---|
|
|
pa(p,a) or ap(a,p)
|
| number whose |
pb(p,b) or bp(b,p)
|
| percentage of |
ab(a,b) or ba(b,a)
|
To remember names of these methods, you can associate
pwith percent,awith greater number (or entire/context number) andbwith less number (number being a part of the entire number -a)
Math.percent.pa(25,200)
// 50 (25% from 200 is 50)
Math.percent.pb(25,50)
// 200 (200 is number whose 25% is 50)
Math.percent.ab(200,50)
// 25 (25% is percentage of b in a)