Calculates what percentage the 'part' is of the 'whole'.
The portion of the whole.
The total or whole value.
The percentage value of part relative to whole.
part
whole
Will throw an error if whole is 0.
percentage(25, 100); // returns 25percentage(50, 200); // returns 25percentage(0, 100); // returns 0 Copy
percentage(25, 100); // returns 25percentage(50, 200); // returns 25percentage(0, 100); // returns 0
Calculates what percentage the 'part' is of the 'whole'.