C# Decimal Decimal(Int32)
Description
Decimal Decimal(Int32)
initializes a new instance of
Decimal to the value of the specified 32-bit signed integer.
Syntax
Decimal.Decimal(Int32)
has the following syntax.
public Decimal(
int value
)
Parameters
Decimal.Decimal(Int32)
has the following parameters.
value
- The value to represent as a Decimal.
Example
The following code example creates several Decimal numbers using the constructor overload that initializes a Decimal structure with an Int32 value.
/* w ww. j a v a2 s . co m*/
using System;
class DecimalCtorIDemo
{
public static void Main( )
{
decimal decimalNum = new decimal( 999999999 );
Console.WriteLine(decimalNum);
}
}
The code above generates the following result.