Mega Code Archive

 
Categories / C# Tutorial / Development
 

Format as custom

using System;   class Class1   {     static void Main(string[] args)     {             string s;             int x = 2, y = 4;             double[] numArray = {12, 15, 14.5, 145.43, 200};             // format as custom             Console.WriteLine( "\n\nCustom\n------" );             foreach( double num in numArray )             {                 Console.WriteLine( "{0:$#,# + $.#0;} = {0:$#,#.00}", num );             }     }   }