Try our conversational search powered by Generative AI!

Custom rounding value for LineItemDiscountAmount


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

public decimal LineItemDiscountAmount
                return Math.Round(base.GetDecimal(LineItemDiscountAmountField), 2);
                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.

Oct 06, 2017 11:39

This article explains how to return a value with the correct number of decimals, which is determined by the input currency: It applies to Commerce versions 10 and up.

Edited, Oct 09, 2017 18:24

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.

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

Oct 09, 2017 19:55

@Quan: yes, I already fired a feature request on our internal channel with type "market input"

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.

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.