Gossamer Forum
Home : Products : Gossamer Links : Discussions :

not too hard questio help....

Quote Reply
not too hard questio help....
Hi, on my top rated page the rating is out of 10, how can I make a simple global so it returns out of 5? Thanks in advance.
Quote Reply
Re: [flybuzz] not too hard questio help.... In reply to
heheh.. nice and simple;

Code:
sub {
my $rating = sprintf "%.2f", $_[0] / 2;
return $rating;
}

..and call with;

<%global_name($Rating)%>

Basically, it will split the rating in half, and then round it off to 2dp.

Hope that helps.

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!