Child pages
  • [in-commerce] Total order amount (calculated field) is rounded twice
Skip to end of metadata
Go to start of metadata

Imported From:

Total order amount (calculated field) is rounded twice:

  • in calculated field declaration (MySQL ROUND(<expr>, 2) function)
  • in virtual field associated with given calculated field (via formatter)

When site uses multiple currencies, then all prices are stored in database in primary currency. All currency conversions work, except for TotalAmount calculated field, because of double round it operates with M.NN number instead of M.NNNN and looses some cents during conversions of course.

For example:

  • Site primary currency is LVL
  • Current currency on Front-End is EEK, which has 0.0449 conversion rate related to LVL
  • Product price is: 26.9827 LVL
  • Shipping price is: 3.0061 LVL

Field TotalAmount shows 669.93, but it should show 667.90 instead.

Related Tasks

MINC-37 - Getting issue details... STATUS


  1. Here is the patch to fix this.

  2. Yes, I confirm that TotalAmount is rounded in MySQL iv orders_config.php

    'TotalAmount' =>
    'ROUND(SubTotal+ShippingCost+VAT+ProcessingFee+InsuranceFee-GiftCertificate Discount,2)',

    Here is a task for it:

    552: Total Order Amount (calculated field TotalAmount) is Rounded Twice

    MINC-37 - Getting issue details... STATUS