Allora ho risolto così, in modo un po architettoso!
codice:
MEDIA = (carrello.Fields.Item("PREZZO").Value)
TOT = 1
if (carrello.Fields.Item("PREZZO1").Value) <> "0" then
MEDIA = MEDIA + (carrello.Fields.Item("PREZZO1").Value)
TOT = TOT + 1
end if
if (carrello.Fields.Item("PREZZO2").Value) <> "0" then
MEDIA = MEDIA + (carrello.Fields.Item("PREZZO2").Value)
TOT = TOT + 1
end if
if (carrello.Fields.Item("PREZZO3").Value) <> "0" then
MEDIA = MEDIA + (carrello.Fields.Item("PREZZO3").Value)
TOT = TOT + 1
end if
if (carrello.Fields.Item("PREZZO4").Value) <> "0" then
MEDIA = MEDIA + (carrello.Fields.Item("PREZZO4").Value)
TOT = TOT + 1
end if
PREZZOMEDIO = MEDIA / TOT
PRICE = PREZZOMEDIO+(PREZZOMEDIO*PERCENTUALE)
response.Write("<p class=""prezzo"">"&FormatCurrency(PRICE, 2, -2, -2, -2)&"</p>")
qualche suggerimento per snellire?