Search This Blog

Friday, December 28, 2012

How many data types in C# (Decimal type )


Decimal type
The decimal type in C# (not available in C, C++ or Java) is a 128-bit data type. It is mainly used for financial and monetary calculations. It’s range is between 1.0 * 10-28 to 7.9 * 1028 .
// Example for decimal types

using System;

    class decimal_types
    {
        public static void Main(string[] args)
        {
            decimal d = 1233455.25m;
            Console.WriteLine("Decimal Value: " +d);


        }
 }


Output:

   Decimal Value:1233455.25




No comments :