integer math in a smarty template
I need to figure out when to restart a loop so I need to do this
<code>
{$ItemOrderby = 100}
{if $p.orderby gte "100" }
{$idiff = $ItemOrderby - $p.orderby }
IDIFF = {$idiff} <!-- just printing it out - it's alway blank ...
Difference = ITEM {$ItemOrderby} less current {$p.orderby} = {$idiff}
{if $idiff gte "100" }
</ul>
{$ItemOrderby = $p.orderby}
{/if}
</code>
but anyway - it's not doing the subtraction ... I found an old post from 2008 that said use {math}
but that it's slow ... and also 2008 was ages ago
what is the best way to do this now ?
thanks
DonnaNJ
|