Se intendete questo, il risultato non cambia:
codice:
<%
if Instr(1, CStr(avgRating), ".") > 0 then
avgWhole = Left(CStr(avgRating), Instr(1, CStr(avgRating), ".")-1)
decPart = Mid(CStr(avgRating), Instr(1, CStr(avgRating), ".")+1, 2)
if decPart <> "" then
if CInt(decPart) >= 5 then
decCalc = .5
else
decCalc = 0
end if
finalRating = CInt(avgWhole) + CCur(decCalc)
else
finalRating = avgRating
end if
else
finalRating = avgRating
end if
for i = 1 to CInt(finalRating)
finalRating = 0
response.write "AAA"
Response.Write "[img]../news/starimages/star.gif[/img]"
next
if CInt(finalRating) <> finalRating then
response.write "BBB"
Response.Write "[img]../news/starimages/rating_star_blank.png[/img]"
for i = CInt(finalRating)+2 to 8
finalRating = 0
response.write "CCC"
Response.Write "[img]../news/starimages/rating_star_blank.png[/img]"
next
else
for i = CInt(finalRating)+1 to 8
finalRating = 0
response.write "DDD"
Response.Write "[img]../news/starimages/rating_star_blank.png[/img]"
next
end if
if CInt(finalRating) <> finalRating then
response.write "EEE"
Response.Write "[img]../news/starimages/rating_star_blank.png[/img]"
end if
%>