int format : Int format : Data Type C# Examples


C# Examples » Data Type » Int format »

 

int format









    
using  System;

public  class  FormatSpecApp
{
        public  static  void  Main(string[]  args)
        {
                int  i  =  123456;
                Console.WriteLine("{0:C}",  i);  //  ?23,456.00
                Console.WriteLine("{0:D}",  i);  //  123456
                Console.WriteLine("{0:E}",  i);  //  1.234560E+005
                Console.WriteLine("{0:F}",  i);  //  123456.00
                Console.WriteLine("{0:G}",  i);  //  123456
                Console.WriteLine("{0:N}",  i);  //  123,456.00
                Console.WriteLine("{0:P}",  i);  //  12,345,600.00  %
                Console.WriteLine("{0:X}",  i);  //  1E240
        }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Type
» Int format