Re: smary assign var

From: Date: Fri, 19 Nov 2010 01:27:26 +0000
Subject: Re: smary assign var
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-309567@lists.php.net to get a copy of this message
On Fri, 2010-11-19 at 00:59 +0100, Tontonq Tontonq wrote: > hi guys > i have 2x sub value > > [reduction] => 4 > [price_without_reduction] => 22 > [price] => 18 > > and i want to calculate how much i did reduction percent > > {assign var='yuzde' value=$product.reduction*100} > {assign var='yuzde' value=$yuzde/$product.price_without_reduction} > > -{$yuzde|truncate:3:''|escape:'htmlall':'UTF-8'}% > when i escape only 3 chars i see some products returns > like "-18.%" > when i escape only 2 chars > i get e result like > "-5.%" > > so is there a way to round that value to int not float? Is there any PHP in there, because I'm not seeing it... Thanks, Ash http://www.ashleysheridan.co.uk

« previous php.general (#309567) next »