Gossamer Forum
Quote Reply
Calculations
How to divide 2 variables and display it as a third? I tried several versions but with no result ... CrazyMad

Thanks in advance.
Quote Reply
Re: [katakombe] Calculations In reply to
Hi,

A global could do this (you could probably also do it in a template tag, but can't remember off hand =))

Code:
do_divide
sub {
return $_[0] / $_[1];
}


<%do_divide($variable1,$variable2)%>

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!
Quote Reply
Re: [Andy] Calculations In reply to
Brilliant as always .. CoolSmile

Thank you Andy!
Quote Reply
Re: [katakombe] Calculations In reply to
You can just do <%var1 / $var2%>

Adrian
Quote Reply
Re: [brewt] Calculations In reply to
Thank you Brewt!

In fact, the complete scenario looks like:

Code:
A * A * 12 / 365 / B

Anyway, Andy's solution work fine Smile