Hi Dynamicweb
I'm trying to format prices in a Razor template, in DW version 9.14.9.
For this I'm using the CurrencyService from the "Dynamicweb.Ecommerce" - module, to format prices depending on the currency settings.
Based on the API documentation, there are 2 methods for formatting currencies:
currencyService.Format()
and currencyService.FormatCurrency()
When I'm using the currencyService.Format(), the price is formatted correctly, and the symbol is also placed correctly ("37.551,20 kr."), based on the pattern I've chosen within currency settings.
But the problem with this method is that it automatically rounds the prices, which is why I have to use the currencyService.FormatCurrency()-method instead
When I'm using currencyService.FormatCurrency(), the price is unfortunately formatted using the wrong pattern ("kr.37.551,20"), and I can't use this method either.
I think theres an issue with the "currencyService.FormatCurrency()"-method not formatting the price based on the pattern ("n $") selected within currency-settings, but instead uses the default pattern ("$n"), when formatting prices.
Attached is a note where I've copied the call of each method within a debug session