Developer forum

Forum » Ecommerce - Standard features » Prices with 3 or 4 decimales

Prices with 3 or 4 decimales

Tomas Gomez
Reply

Hi,

Some products of our site have prices with 3 or 4 decimals. They are sold by thousands, and their prices on the orders are calculated correctlly.

But the prices are displayed with only two decimals in the product pages, so it creates confussion.

How could we display more decimals in the prices? We diden't find any setting to do so. A fix could be to modify the templates, but we want to ensure that there not a better option.

Regards,
Tomas


Replies

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

Hi Tomas,

By default the prices are rounded based on the currency culture (with fallback to two decimals).
Two decimals is the standard for most currencies.

If you want to disable the default rounding behavior...

Go to Settings > Ecommerce > Advanced configuration > Prices
Make sure that "Round price calculations by currency culture" is disabled (unchecked).

You should now get the prices without rounding - unless you have selected a specific rounding configuration on the currency.

Best regards,
Morten

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply
This post has been marked as an answer

You probably also need to use different template tags to get the raw values and avoid the fallback which performs rounding to two decimals...

Ecom:Product.Price.Price.Value
Ecom:Order:OrderLine.Price.Price.Value
Ecom:Order:OrderLine.UnitPrice.Price.Value
etc.

Votes for this answer: 1
 
Tomas Gomez
Reply

Hi Morten,

Thanks for the tip. We unchecked that checkbox (it was checked by default) and still same issue. Currency culture has no rounding.

Searching for the reason, we can ensure that price in ERP (BussinessCentral) is with 3 decimals and LiveIntegration response has tree decimals as well (see attached images). However, the stored price in DW product has only two decimals and the frontend shows two decimals.

Is there any other config that we are missing?

Regards,
Tomas

BussinessCentral_price.png DW_backend_price.png DW_frontend_price.png Integration_response.png
 
Tomas Gomez
Reply

Hi again, 

We din't see your last message, we are trying it.

It may be the solution. We checked that the stored value in the database has three decimals (despite the value on the Ecom area displays only two decimals)

 
Tomas Gomez
Reply
This post has been marked as an answer

Yes, it is an issue of the templates.

In Swift_ProductDetailsInfo.cshtml, we changed
      string price = product.Price.PriceWithoutVatFormatted;
for
      string price = product.Price.PriceWithoutVat.ToString();
and now the price is displayed with whatsoever decimals.

Thanks Morten :-)

Votes for this answer: 1

 

You must be logged in to post in the forum