phpopencartrounding

Opencart - round() Function


I have code <?php echo $product['price']+$product['price']*14/100; ?> for showing price with TAX in opencart admin (catalog/product).

But I must get price to full number.

For example I have price "298.9992" but I must have "299" etc.

Can you help me?

Thank you so much!


Solution

  • Just use round without the second parameter or use 0 as value.

    Exemple:

    round(298.9992);
    round(298.9992,0);
    

    For more informations: http://php.net/manual/en/function.round.php