C# Decimal Decimal(Int32[]) Array

Description

Decimal Decimal(Int32[]) initializes a new instance of Decimal to a decimal value represented in binary and contained in a specified array.

Syntax

Decimal.Decimal(Int32[]) has the following syntax.


public Decimal(
  int[] bits
)

Parameters

Decimal.Decimal(Int32[]) has the following parameters.

  • bits - An array of 32-bit signed integers containing a representation of a decimal value.

Example

The following code example creates several Decimal numbers using the constructor overload that initializes a Decimal structure with an array of four Int32 values.


using System;//from  ww  w . ja va  2 s. c o m

class DecimalCtorIArrDemo
{
    public static void Main( )
    {
        decimal decimalNum = new decimal( new int[ ] { 0, 0, 0, 0 } );
        Console.WriteLine(decimalNum);
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version