Format float as decimal in CSharp
Description
The following code shows how to format float as decimal.
Example
using System;//ww w .j a va 2 s. c om
class Sample
{
public static void Main()
{
Console.WriteLine("(D) Decimal:. . . . . . . . . {0:D}\n" + -123, -123.45f);
}
}