I need to get the discount on a product. The old and the new price are in visual composer. I can get them but i can't count them. The old and the new price are integers but when i divide an old price on a new price i receive something like 60.929323229329. And then i have to round this number and subtract it from 100. However it doesn't work
<?php $x = $item['price_list_item_price2'];?>
<?php $y = $item['price_list_old2'];?>
<?php echo ((100) - ($x / $y)); ?>
The result must be for instance 39%