Webmastersite.net
Register Log In

Custom Rating Average
Average Rating

Comments on Custom Rating Average

azteca
Forum Regular

Usergroup: Customer
Joined: Oct 18, 2003

Total Topics: 32
Total Comments: 114
azteca
Posted Jun 01, 2007 - 5:46 PM:

Paul,
Is there a way that you can get an average from group of custom ratings? For example lets say I have customrating1, customrating2, customrating3, customrating4, etc. Can I get a average from the combined ratings? Add all the customratings together and get an overall average rating for all.

Liz
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Jun 02, 2007 - 10:07 AM:

Put this in your template:
<?php
$average = ({LINKCUSTOMRATING1RATING} + {LINKCUSTOMRATING2RATING} + {LINKCUSTOMRATING3RATING}) / 3; // add values, divide by the number
$average = round($average, 2); // 2 decimal places
echo $average; // display
?>
azteca
Forum Regular

Usergroup: Customer
Joined: Oct 18, 2003

Total Topics: 32
Total Comments: 114
azteca
Posted Jun 02, 2007 - 6:49 PM:

Thanks Paul worked like a charm.

Liz
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.