Sunday, 24 November 2013

C#.NET - How to add commas to Currency

Code:

static void Main(string[] args)
        {
            var numbers = new int[] {1, 10, 100, 1000, 10000, 100000, 10000000};
            foreach (var number in numbers)
            {
                Console.WriteLine(number.ToString("#,##0"));
            }
        }
Output:


No comments: