isaaclloyd

08-22-2005, 11:52 PM

Here is the script I am working on:

<%

n1 = 9

n2 = 0

n3 = 0

n4 = 0

n5 = 0

random_total= n1 + n2 + n3 + n4 + n5

total_score = random_total/5

%>

<center>

<font size="5" color="#FF0000">

<%

for count = 1 to round(total_score)

%>

•

<%

next

%>

<font size="5" color="#000000">

<%

for counter = 1 to round((5-total_score))

%>

•

<%

next

%>

</font>

<br>

<font size="3" color="#000000">

<%= round(total_score) & " out of 5" %>

With the 5 different ratings above being 9,0,0,0,0 the average rating should be 1 shouldn't it? Maybe my math is all wrong but this average stuff doesn't seem right. If 5 visitors vote 1 out of 5 stars, and 5 visitor votes 5 out of 5 stars, the average should be like 3, with the script above I get 2.... Anyways, if anyone can see something I am doing wrong I would appreciate the help. Thanks.

~Isaac~

<%

n1 = 9

n2 = 0

n3 = 0

n4 = 0

n5 = 0

random_total= n1 + n2 + n3 + n4 + n5

total_score = random_total/5

%>

<center>

<font size="5" color="#FF0000">

<%

for count = 1 to round(total_score)

%>

•

<%

next

%>

<font size="5" color="#000000">

<%

for counter = 1 to round((5-total_score))

%>

•

<%

next

%>

</font>

<br>

<font size="3" color="#000000">

<%= round(total_score) & " out of 5" %>

With the 5 different ratings above being 9,0,0,0,0 the average rating should be 1 shouldn't it? Maybe my math is all wrong but this average stuff doesn't seem right. If 5 visitors vote 1 out of 5 stars, and 5 visitor votes 5 out of 5 stars, the average should be like 3, with the script above I get 2.... Anyways, if anyone can see something I am doing wrong I would appreciate the help. Thanks.

~Isaac~