-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decimals error? #165
Comments
Yes, looks like a display issue with the option price. As a workaround for now I think you might be able to change the display format in the cart list template. |
And how would I do that? |
not sure of the code off the top of my head.... but change... @NBrightBuyUtils.FormatToStoreCurrency(nbiOpt.GetXmlPropertyDouble("option/optvalcost")) to something like this... @nbiOpt.GetXmlPropertyDouble("option/optvalcost").ToString("C0") Currency should be kept in a Decimal, legacy code has it as a double and it causes a lot of issues and time to get it correctly formatted. But there are lots of formatting options https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings?redirectedfrom=MSDN#CFormatString In OpenStore we have to support many currency formats, including the french who have a format "5,89" and decide to enter in the keypad "5.89". We've had to do some JS and code to help these situations. Maybe we're missing something on the money input field. |
The xml is correct though, and the calculations on the total also.
|
Ok...so what could it be then? Is it the same code: Could it be some culture setting in DNN or something? |
This is in French... maybe something to do with language. try a test system in French and see if it works. |
I think it is this...
Not what you are formatting with. |
Yes, that is the part on the detailpage which is working fine. @NBrightBuyUtils.FormatToStoreCurrency(nbiOpt.GetXmlPropertyDouble("option/optvalcost")) |
Hmm....when I look in the order it shows this: |
See the difference between optvalcost and optvaltotal |
Ah!! Sorry, your using OpenStore v3 (NBrightBuy), I only just noticed. Sorry we have stopped development on this. I'm unsure of the fix, look at OpenStore for a solution, it seems to work in there. https://github.com/openstore-ecommerce/OpenStore |
Nope , we're using 4.1.4 |
OK. Here you put it on the v3 of OpenStore. You should use this forum. https://github.com/openstore-ecommerce/OpenStore/discussions But never mind. The answer I put above is still valid if you use v4. Have a look at the default templates and see what the difference is. |
Yes, well did you see the xml? to it shows the correct 12,50 instead of 125 |
Sorry, missed the email. OK, so you think it should be "optvaltotal" for all templates? It's strange it works for me.
I cannot remember the code for this changing for a long time. |
I've entered 12,50 euro for some option, however in the cart it shows as 125,00.
In the totals it is calculating with the good value however:
So could something be wrong in:
@NBrightBuyUtils.FormatToStoreCurrency(nbiOpt.GetXmlPropertyDouble("option/optvalcost"))
The text was updated successfully, but these errors were encountered: