November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
Hi,
Did you tried with
UnitPrice = new Money(8.12m, "DKK") instead?
/Q
No luck - same result with shorthand decimal :o(
The code above is an extract of a Unit Test of the method i use to (dynamically) insert prices. The method containing the code receives a decimal UnitPrice (and Currency string).
Hi,
Can you check if the price stored in database was correct? It should be in PriceDetail table.
The price is stored as Money, which should keep the precision of ten-thousandth. As we have intensive tests in this area then I'm pretty sure that we did it right.
Regards.
/Q
The value is inserted as 8.00 DKK in the PriceDetail table.
I'm sure you did it right, but in my case it's not behaving as expected (and yes, Money data type allows 4 decimals, the EPiServer UI/API however supports only 2 decimals in practice - but thats beside the point).
I am however having a hard time debugging from the point of the .Save() of IPriceDetailService.
Hi,
What if you use the Catalog UI to edit prices? Are them saved properly?
/Q
Yes, the UI saves the prices as expected (entering 8,12 - note the comma) saves the price as 8.12 DKK.
Could it be related to the different decimal mark i'm wondering (even though the actual decimal inserted through the API is 8.12)?
Might be - logically it's weird if .NET simply parse 8.12 as 8.0 if the current culture uses , as the decimal parameter - but it won't hurt to test with 8.12, right? ;)
Regards.
/Q
Well, the EPiServer Catalog UI changes the price to 8.00 if i enter 8.12 and press enter :o)
I have no clue what to try next though :o/
It might sound stupid but make sure you don't have custom implementation of IPriceDetailService. The default implentation use ecf_PriceDetail_Save stored procedure, which is quite straighforward and no convert/truncating should happen.
If this issue is serious enough - I suggest to contact our support service for proper investigation.
Regards.
/Q
Nope, I'm not using a custom implementation (but considering doing so - would prefer not to though). The ecf_PriceDetail_Save procedure is used in this case also (tried renaming it to make sure it failed).
I will make some further attempts and contact support service if necessary. Thanks for the effort though Quan - greatly appreciated :o)
Oh and by the way, i can resolve the issue by (and this is a temporary workaround):
1. Save the price as described above.
2. Get the price i just created using IPriceDetailService.Get()
3. Invoke new PriceDetailValue(priceJustCreated)
4. Set the price again.
5. Save yet again.
Just in case anyone else needs a workaround.
I'm opening an issue in with support service :o)
Hi
I feel like i'm missing something obvious here. I'm trying to insert a price of 8.12 DKK, but when saving to the database the value changes to 8.00 DKK.
I then create the price using:
The market has DKK and EUR as active currencies.
Any help would be greatly appreciated.
Best Regards
Morten Kristensen