Declare decimal variable : Decimal : Data Type C# Examples


C# Examples » Data Type » Decimal »

 

Declare decimal variable






decimal is intended for use in monetary calculations.
decimal utilizes 128 bits to represent values within the range 1E-28 to 7.9E+28.
decimal eliminates the rounding errors caused by the normal floating-point data type.





    
using  System;
using  System.Collections.Generic;
using  System.Text;

class  MainClass
{
        static  void  Main(string[]  args)
        {
                decimal  myDecimal  =  150;
                double  myDouble  =  150;
        }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Type
» Decimal