Re: Tired and feeling dumb...maths question....

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



$average = round(($votes/$pts),2);

;)

Ryan A wrote:

people vote on a scale of 1-5, so the average should be between 1-5
(right?? am not even sure of this!)
Yes.

I was thinking of rounding it with a 2 decimal point...eg:
round(5.045, 2)

Just need to solve this and them am hitting the sack, any help
appreciated.
Solve what? I must have missed the problem.


Oops, sorry guys...girlfriends on holiday so have not had my "medicine"
:-)
and am also braindead right now...

basically...how do I get the average?

$pic_no_of_votes --- > holds the total number of votes (eg: 212)
$vote_total_pts ----> holds the total points from all those votes (eg:
1027)

how do i get the average down to something like: 3.23 or 1.02 or 4.11 etc

Thanks,
Ryan


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux