Try our conversational search powered by Generative AI!

Custom rounding value for LineItemDiscountAmount

Vote:
 

A quick view of Mediachase.Commerce.Orders.LineItem class we can see that rounding value for LineItemDiscountAmount is hardcoded to 2:

public decimal LineItemDiscountAmount
        {
            get
            {
                return Math.Round(base.GetDecimal(LineItemDiscountAmountField), 2);
            }
            set
            {
                base[LineItemDiscountAmountField] = Math.Round(value, 2);
            }
        }

So with a marketing system that needs high precision, it makes them useless.

My suggestion is we need that rounding value to be configurable or extendable not hardcoded like that.

#183184
Oct 06, 2017 11:39
Vote:
 

This article explains how to return a value with the correct number of decimals, which is determined by the input currency: https://world.episerver.com/documentation/developer-guides/commerce/orders/rounding-totals-for-currencies/. It applies to Commerce versions 10 and up.

#183251
Edited, Oct 09, 2017 18:24
Vote:
 

I think Khanh is mentioning another issue. Tobias Nilson mentioned this as well - but he didn't file a bug as I told him - so I will do it. https://jira.ep.se/browse/COM-5619

@Khanh: As an Episerver employee, you have more direct channels to file feature requests :)

#183252
Oct 09, 2017 19:55
Vote:
 

@Quan: yes, I already fired a feature request on our internal channel with type "market input" https://jira.ep.se/browse/COM-5614.

But it is not public to our partner, so I fired it here too :) 

If it is considered as a bug, it would be really great. Thanks Quan.

#183270
Oct 10, 2017 6:26
This thread is locked and should be used for reference only.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.