Formatting currency values : Decimal format : Data Type C# Examples


C# Examples » Data Type » Decimal format »

 

Formatting currency values









    
class  MainClass
{
    public  static  void  Main(){
        //  
        decimal  myMoney  =  15123.45m;
        System.Console.WriteLine("myMoney  using  10:c2  =  {0,  10:c2}",myMoney);
    }

}
    
   
  
   



Output

myMoney using 10:c2 = $15,123.45


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Type
» Decimal format