Jump to content

Get average/ratio


The Little Guy

Recommended Posts

I can't remember the math to do this, but I use MySQL to calculate an average:

 

5 = 100%

0 = 0%

 

I want to make a bar that shows an average (like a bar graph)

 

so lets say I get 2.5 as one of my returned results, that means the bar should only be 50% long of the maximum width.

 

Using calculations, how can I get the number 50 (the max width is 100% of a table cell)?

Link to comment
https://forums.phpfreaks.com/topic/231910-get-averageratio/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.