1

I'm rewriting http://209.141.38.179/mcstatus_v1/ and need an equation.

Basically, I have a game server. I know that there are 10 players on that server (Max players being 26). I need to somehow display this number in a progress bar that is out of 100; I need to find out the percentage of 26 that is 10 and then make that a percentage of 100.

An example is 13 of 26. I know that's 50%; the progress bar value would be 50.

Any help is appreciated.

1 Answers1

1

$$\frac{x}{26} = \frac{y}{100}.$$ If you have $x$ players, then the percentage you're looking for is $$y = 100\frac{x}{26}.$$

snar
  • 7,388
  • 22
  • 25
  • This is correct. So for instance, Tayler, if you have 10 people, then the calculation is $10\cdot 100 / 26 = 38.46153846...$ You will likely want to round this to 38. – Michael Grant Feb 09 '14 at 19:37