Numeric Formatting : Number format : Data Type C# Examples


C# Examples » Data Type » Number format »

 

Numeric Formatting









    
using  System;

class  MainClass
{
        public  static  void  Main()
        {
        Console.WriteLine("{0:G}",  12345.8977);
        Console.WriteLine("{0:G7}",  12345.8977);
        Console.WriteLine("{0:G4}",  12345.8977);
        }
}
    
   
  
   



Output

12345.8977
12345.9
1.235E+04


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Type
» Number format