Re: [PHP] Tired and feeling dumb...maths question....

2005-07-14 Thread Matt Darby
$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 hittin

Re: [PHP] Tired and feeling dumb...maths question....

2005-07-14 Thread Lawrence Kennon
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 average = 1027 (total pts) / 212 (numb

RE: [PHP] Tired and feeling dumb...maths question....

2005-07-14 Thread Ryan A
> > 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. > >

RE: [PHP] Tired and feeling dumb...maths question....

2005-07-14 Thread Chris W. Parker
Ryan A on Thursday, July 14, 2005 12:17 PM said: > Hey, Hey. > 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

Re: [PHP] Tired and feeling dumb...maths question....

2005-07-14 Thread Ezra Nugroho
The result should be between 1 - 5. Can you clarify the following: > Basically, I have these two fields: > $pic_no_of_votes > $vote_total_pts What do they hold? Sums or individual votes? > and this totals them up and keeps the average: > $average_pts > > people vote on a scale of 1-5, so the a

[PHP] Tired and feeling dumb...maths question....

2005-07-14 Thread Ryan A
Hey, At this stage am pretty much brain dead and getting a simple percentage is too much for me now. Basically, I have these two fields: $pic_no_of_votes $vote_total_pts and this totals them up and keeps the average: $average_pts people vote on a scale of 1-5, so the average should be between 1-