Mega Code Archive

 
Categories / C# Tutorial / Development
 

Format as currency

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 currency             Console.WriteLine( "\n\nCurrency\n--------" );             foreach( double num in numArray )             {                 Console.Write( "{0:C}\t", num );             }     }   }