|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
FrankinHolland Smarty Rookie
Joined: 19 Jul 2011 Posts: 14
|
Posted: Fri Dec 09, 2011 1:04 am Post subject: Is it possible to do math in Section Loops? |
|
|
Hi. I am trying to do currency conversion on the fly in a Smarty Section Loop. This is what I have (minus irrelevant stuff):
{section name=i loop=$FeaturedProduct}
..
..
<td height="17" class="redmatter">Price: {if $FeaturedProduct[i].dPrice neq ""}{$FeaturedProduct[i].dPrice}{else}{$FeaturedProduct[i].text}{/if}</td>
{/section}
I really want to multiply {$FeaturedProduct[i].dPrice} by a currency converter. Is this possible on the fly by adding something like * 1.564 or a variable? If so what would the syntax be?
Thanks very much. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
|
Back to top |
|
FrankinHolland Smarty Rookie
Joined: 19 Jul 2011 Posts: 14
|
Posted: Tue Mar 20, 2012 11:58 pm Post subject: Thanks! |
|
|
Thanks again! I somehow missed this reply and found another way but this is very useful. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|