Number Formatting String (N) in C#

Below is a sample source code demonstrating the Number Formatting String (N) in C#.

using System;

namespace ConsoleApplication1

{

internal class Program

{

// General Numeric Formatting in C#

private static void Main(string[] args)

{

float input = 107.7899F;

Console.WriteLine("{0:N}", input);

Console.WriteLine("{0:N10}", input);

Console.ReadLine();

}

}

}
Number Formatting String (N) in C#