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.
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
Comment #1
georgemastro commentedIt's line 96 in node-deal.tpl.php...
Comment #2
volvic0402 commentedHi 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);
Comment #3
nchar commented