tags:

views:

50

answers:

2

I am working on a project for my company, and while tracing previously written code I came upon this:

<value>A payment authorization for {0:C} has been received.</value>

What does {0:C} mean? I have been trying to find out and am having no luck.

+3  A: 

It's formatting a number as currency.

48klocs
thanks for the link
0_o
+3  A: 

This is just a string like any other string. Once loaded into memory, it will be used as the format parameter to string.Format. {0:C} just means to format the number as currency using the current UI culture (or is it just current culture? I can never remember).

Matt Greer
+1, pretty much verbatim what I was going to say.
Eric Petroelje
Put another way, it's simply a string, but `String.Format()` searches the string for these patterns and replaces them with another formatted string.
Nelson
Thanks. That should help get me started.
0_o