LISE Compare a value

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
webform
Power Poster
Power Poster
Posts: 458
Joined: Sat Nov 25, 2006 3:39 pm
Location: Copenhagen, Denmark

LISE Compare a value

Post by webform »

I'm using LISE to store weight reports for projects, and need to compare the weight between 2 weight reports and show the difference in percentage.

I have the equation to use, but is stuck how i get the weight value from each report to calculate.

Code: Select all

{math equation='((x-y)/y*100)' x=$weight1 y=$weight2 format='%.2f' assign='difference'}
I always have 2 reports to compare/calculate, so i'm thinking i'll need to do something like this:

Code: Select all

{if $smarty.foreach.foo.first}
{assign var="weight1" value=$item->fielddefs.weight.value}
{else}
{assign var="weight2" value=$item->fielddefs.weight.value}
{/if}
But is unsure if this is the best way to do it?

Any suggestions are greatly appreciated.
Post Reply

Return to “Modules/Add-Ons”