function GetPercentage(num1, num2) {
return (num1 / num2) * 100;
}
console.log("25 is " + GetPercentage(25, 100) + "% of 100");
console.log("100 is " + GetPercentage(100, 25) + "% of 25");
console.log("20 is " + GetPercentage(20, 57) + "% of 57");
console.log("20 is " + GetPercentage(20, 57).toFixed(2) + "% of 57");
/*
run:
25 is 25% of 100
100 is 400% of 25
20 is 35.08771929824561% of 57
20 is 35.09% of 57
*/