programming-examples/js/Math/Calculate the percentage (%) of a number.js
2019-11-15 12:59:38 +01:00

6 lines
121 B
JavaScript

function percentage(num, per)
{
return (num/100)*per;
}
console.log(percentage(1000, 47.12));