Smarty: adding two numbers
Let’s start with the initialization:
{assign var="iItemOne" value=1}
{assign var="iItemTwo" value=2}
Beware that the first code is working, while the second is not:
{* Working sample *}
{assign var="iSum" value=$iItemOne+$iItemTwo}
Result of adding {$iItemOne} and {$iItemTwo} is {$iSum}.
{* Not working sample *}
{assign var="iSum" value=$iItemOne + $iItemTwo}
Result of adding {$iItemOne} and {$iItemTwo} is {$iSum}.
very useful information. thanks!
In the case floating number?
a=10.00
b=10.00
a+b getting 20 , not 20.00 ?