XF 2.1 Basic template variable maths question.


Active member
Poking my fat fingers at the keyboard to do something pretty basic...

$lasttipround should come out as "12".

Should this work? It doesn't seem to. How can I make it work? Thanks.

<xf:set var="$currenttipround" value="13" />
<xf:set var="$lasttipround" value="{$currenttipround} - 1" />
<xf:set var="$tipround_last" value="{{$tipround_current}} - 1" />

Makes $tipround_last a string: 13 - 1

Need to do maths, but can't see any guide on this.
Thanks - yeah I worked out I was the victim of bracket creep:
<xf:set var="$tipround_last" value="{{$tipround_current - 1}}" />
Top Bottom