programming-examples/js/Math/Calculate the percentage (%) of a number.js

6 lines
121 B
JavaScript
Raw Normal View History

2019-11-15 12:59:38 +01:00
function percentage(num, per)
{
return (num/100)*per;
}
console.log(percentage(1000, 47.12));