Hello, how do you round the percentages, so as not to include the decimal in them? I figured it out with the pricing, but can't seem to see it with the discount percentage.

Comments

georgemastro’s picture

It's line 96 in node-deal.tpl.php...

volvic0402’s picture

Hi George, I can see it there and the function looks to be correct, but I still have a percentage of 61.03% as the discount. Here is what's in the node-deal.tpl.php:

$discount = 1 - ($content['product:commerce_price']['#items'][0]['amount']/$content['product:field_or_price']['#items'][0]['amount'] * 100);
$currency = commerce_currency_load($content['product:commerce_price']['#items'][0]['currency_code']);
$discount = commerce_currency_round(abs($discount), $currency);

nchar’s picture

Status: Active » Closed (fixed)