2.9 is 14.5 in a score of 20 for the given 4 entries is it correct

89 Views Asked by At

For example number of working days is 4,

7/10=0.7
8/10=0.8
9/10=0.9
5/10=0.5
Total is:

Total =.7+.8+.9+.5=2.9

How can I calculate this total (2.9) as a percentage of the total (20)?

Is my attempt correct below:

Computed to 20% = (sum of values for four days)%(number of working days)*20

= (2.9)%4*20 = 14.5

3

There are 3 best solutions below

5
Vignesh Raja On

To calculate the percentage, totalvalue/100*percentagevalue i.e, 30/100*20 calculates to 20% of 30.

var a=7,b=8,c=9,d=5;
var values = a/10+b/10+c/10+d/10;
var percentage = values/100*20;
console.log("Total : "+(a+b+c+d),"Values : "+values,"Percentage : "+percentage.toFixed(2));

4
papaya On

By reading the discussion, I think @ramu, what you have given is correct. Yes 2.9 is 14.5 in a score of 20 for the given 4 entries.

You would need to multiply 2.9 * 5 = 14.5 which is out of 20. This is correct.

0
achAmháin On

Your total is 2.9. As (sort-of) explained in the comments, you want to know what percentage of the overall total (20 in your example) is.

You can either:

  • Multiply (2.9) by 100 and divide by your total (20) - giving 14.5%
  • Or just in this use-case, multiply (2.9) by 5.