Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [Gorospe] Average from 3 fields

Quote Reply
Re: [Gorospe] Average from 3 fields In reply to
Hi,

Something like this should do the trick:

get_average_value
Code:
sub {
return sprintf("%.0f", ($_[0]+$_[1]+$_[2]) / 3)
}
Call with:

Code:
<%get_average_value($field1,$field2,$field3)%>

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Subject Author Views Date
Thread Average from 3 fields Gorospe 2665 Mar 15, 2012, 8:06 AM
Thread Re: [Gorospe] Average from 3 fields
Andy 2604 Mar 15, 2012, 11:42 AM
Thread Re: [Andy] Average from 3 fields
Gorospe 2603 Mar 15, 2012, 12:17 PM
Post Re: [Gorospe] Average from 3 fields
Andy 2620 Mar 15, 2012, 12:58 PM