Developer forum

Forum » Development » Changing how Price.PriceFormated formats price

Changing how Price.PriceFormated formats price

Dmitrij Jazel
Reply

Hi guys,

I was requested to change the way website is displaying Kronas.

F.eks. Instead of "kr. 1 999,00" customers would like to see "kr. 1 999,-"

basically turn ,00 into ,- would like to hear some suggestions/ideas on how to do this?

 

Forgot to mention, this must only be applyed to Kronas (norwegian, danish, and swedish). Other currencies like EUR, USD and GBP must be unchanged.

Website uses multiple currencies.

 

/Dmitrij


Replies

 
Nicolai Høeg Pedersen
Reply

if currency = dkk, no, se{

String.Replace(",00", ",-")

}

Or just ask them "Why, would you sell more?"

 
Dmitrij Jazel
Reply

Hi Nicolai,

Thanks for reply! :-)

Well this must only apply NOK SEK and DKK currencies only. So I need to get this. "kr." in the front I guess.

 

Yes, but this means I have to keep this in all the templates?

What I was thinking if there was a possibility to do that somewhere in the system somehow, either by implementing some interface, or any other API trick.

But this is also OK, since we are using Razor, I think I can create a helper method that will do that. But if we would be using HTML that would probably be an issue, wouldn't it?

 

So my guess is there is nothing in the system currently that could handle this formating, and you could define your own.

 

 

But still thanks for info :-)

 

/Dmitrij

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

For HTML templates you could write a tag extension: http://developer.dynamicweb.com/forum/development/execution-time-of-tag-extensions.aspx?PID=48

Imar

 

You must be logged in to post in the forum