Home > Back-end >  How to calculate the percentage. Bosses give directions
How to calculate the percentage. Bosses give directions

Time:09-27

Internet js code
No matter how much I preach is % 2 refs



I hope it's calculated

The percentage of 100 5=250
The percentage of 100 10=500

The percentage of 100 100=5000


Like that, no matter how much I preach and this always % % 2 or 10000

Bosses advice please


 function Percentage (num, total) {
If (num==0 | | total==0) {
return 0;
}
Return (Math. Round (num/total * 10000)/100.00);//two decimal places percentage
}


CodePudding user response:

Resolved


Math. Round (a * b)/100.00)
  • Related