Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > How do I format money in Kentico View modes: 
User avatar
Member
Member
lethanhclub-gmail - 11/24/2011 11:50:39 PM
   
How do I format money in Kentico
I am using macro in html kentico.
{%currentdocument.Price%}

I want it show that: $x.xx
example:
0 -> $0.00
1->$1.00
1.1->$1.10
1.01->$1.01

So macro in kentico can do that?

Please help me.

User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 11/30/2011 11:37:29 AM
   
RE:How do I format money in Kentico
You can use the format Macro

{%currentdocument.Price|(format)C%}


Where the format string "C" is currency. You get the same result in the C# code:

Price.ToString("C");

User avatar
Kentico Support
Kentico Support
kentico_radekm - 12/6/2011 1:16:26 AM
   
RE:How do I format money in Kentico
Hello.

Let me just provide some additional info you could use. Here you can see how to use “Currency formatting string” property.

Formatting strings can be found here.

Best Regards,
Radek Macalik