Display a percentage : Double Format : Data Type C# Examples


C# Examples » Data Type » Double Format »

 

Display a percentage









    
using  System;    

class  MainClass  {    
    public  static  void  Main()  {    
        double  num  =  0.17;          
        Console.WriteLine("Default  format:  "  +  num);  
        Console.WriteLine("Display  a  percentage:  {0:#%}",  num);  
    }  
}
    
   
  
   



Output

Default format: 0.17
Display a percentage: 17%


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Type
» Double Format