Format 0 specially for double value format in CSharp
Description
The following code shows how to format 0 specially for double value format.
Example
using System;//from w w w . j a va 2s. c o m
public class MainClass
{
public static void Main()
{
double posValue = 1234;
double negValue = -1234;
double zeroValue = 0;
string fmt2 = "##;(##)";
string fmt3 = "##;(##);**AAA**";
Console.WriteLine(posValue.ToString(fmt2));
Console.WriteLine(negValue.ToString(fmt2));
Console.WriteLine(zeroValue.ToString(fmt3));
}
}
The code above generates the following result.