I\'m trying to use String.Format(\"{0:c}\", somevalue) in C# but am having a hard time figuring out how to configure the output to meet my needs. Here are my needs:
The "C" currency formats are great until you need a blank for 0. Here are two ways, one mentioned above, similar to the ones that I use that give you the blank for 0:
// one way
string.Format("{0:$#,##0.00;($#,##0.00);''}", somevalue)
// another way
somevalue.ToString("$#,##0.00;($#,##0.00);''")
The second technique feels more "fluent", if you like that style of code (as I do).