I am trying to make a calculation based on the database value.Basically I am displaying some data by following code in my tpl
file
<table cellpadding="2" cellspacing="0">
{foreach from=$data item=item key=key}
<tr>
<td>{$item.Country}</td> <td>{$item.count}</td> <td>{$item.sum}</td>
<tr>
{/foreach}
</table>
Now I need to make a calculation based on {$item.count}
and {$item.sum}
By searching I am finding below smarty math calculation formula
{* $height=4, $width=5 *}
{math equation="x + y" x=$height y=$width}
But can not assign my database variable.How can I do this