Blog
Developers
Careers
Support
Contact
Gossamer Threads
Solutions
Results
About
Mailing Lists
Resource Centre
Forum
Tools
Home
Who's Online
Tags
Favourites
Login
Register
Forum Search
(
Advanced Search
)
This forum
This category
All forums
for
Home
:
Products
:
Gossamer Links
:
Development, Plugins and Globals
:
Calculations
Previous Thread
Next Thread
Print Thread
View Threaded
Dec 3, 2009, 9:44 AM
katakombe
User
(127 posts)
Dec 3, 2009, 9:44 AM
Post #1 of 5
Views: 816
Shortcut
Calculations
How to divide 2 variables and display it as a third? I tried several versions but with no result ...
Thanks in advance.
Dec 3, 2009, 11:30 AM
Andy
Veteran
/ Moderator
(17366 posts)
Dec 3, 2009, 11:30 AM
Post #2 of 5
Views: 797
Shortcut
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
IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my
Amazon Wish List
GLinks ULTRA Package
(plugins total "value" $3,325 & rising, for just $350)|
GLinks ULTRA Package PRO
(plugins total "value" $5,625 & rising, for just $500)
Support Forum
|
Links SQL Plugins
|
DMOZ Dumps
|
UltraNerds
|
ULTRAGLobals Plugin
|
Pre-Made Template Sets
|
FREE GLinks Plugins!
Compare our different Plugin packages
*new*
Free CSS Templates
Dec 4, 2009, 7:20 AM
katakombe
User
(127 posts)
Dec 4, 2009, 7:20 AM
Post #3 of 5
Views: 770
Shortcut
Re: [Andy] Calculations
In reply to
Brilliant as always ..
Thank you Andy!
Dec 4, 2009, 4:30 PM
brewt
Staff
(4071 posts)
Dec 4, 2009, 4:30 PM
Post #4 of 5
Views: 750
Shortcut
Re: [katakombe] Calculations
In reply to
You can just do <%var1 / $var2%>
Adrian
Dec 4, 2009, 8:38 PM
katakombe
User
(127 posts)
Dec 4, 2009, 8:38 PM
Post #5 of 5
Views: 742
Shortcut
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
Previous Thread
Next Thread
Print Thread
View Threaded