It's not the duplicate of this qst.

I am not trying to hide decimal, but trying to round the product price. But in same time not rounding the tax. So tax should be calculated having 2 decimal, but product price should be rounded to none-decimal.

Org Qst

I am trying to round product prices by changing following function in Mage_Directory_Model_Currency and it works:

     * Format price to currency format
     * @param float $price
     * @param array $options
     * @param bool $includeContainer
     * @param bool $addBrackets
     * @return string
    public function format($price, $options = array(), $includeContainer = true, $addBrackets = false)
        //return $this->formatPrecision($price, 2, $options, $includeContainer, $addBrackets);
        return $this->formatPrecision($price, 0, $options, $includeContainer, $addBrackets);

However, above changes triggers tax issue. Because it also rounds my tax.

For example: when my product price is $1629 and qty in cart is 1, then my cart total area will look like this:

Subtotal                 $1,629
Grand Total Excl. GST    $1,481
GST (10%)                  $148
Grand Total Incl. GST    $1,629

Here, actual tax is $148.10 but because of rounding it is shown as $148. This is against the tax rule set by gov.

My question

How can I round all product prices but show GST with at least 2 decimal point?


What I would like to have?

GST (10%)               $148.10
Grand Total Incl. GST    $1,629

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.