smary assign var

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux