Export (0) Print
Expand All

Decimal Constructor (Int32, Int32, Int32, Boolean, Byte)

Initializes a new instance of Decimal from parameters specifying the instance's constituent parts.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

new : 
        lo:int * 
        mid:int * 
        hi:int * 
        isNegative:bool * 
        scale:byte -> Decimal

Parameters

lo
Type: System.Int32

The low 32 bits of a 96-bit integer.

mid
Type: System.Int32

The middle 32 bits of a 96-bit integer.

hi
Type: System.Int32

The high 32 bits of a 96-bit integer.

isNegative
Type: System.Boolean

true to indicate a negative number; false to indicate a positive number.

scale
Type: System.Byte

A power of 10 ranging from 0 to 28.

ExceptionCondition
ArgumentOutOfRangeException

scale is greater than 28.

The binary representation of a Decimal number consists of a 1-bit sign, a 96-bit integer number, and a scaling factor used to divide the integer number and specify what portion of it is a decimal fraction. The scaling factor is implicitly the number 10 raised to an exponent ranging from 0 to 28.

The following code example creates several Decimal numbers using the constructor overload that initializes a Decimal structure with three Int32 value words, a Boolean sign, and a Byte scale factor.

No code example is currently available or this language may not be supported.

The following example uses the GetBits method to retrieve the component parts of an array. It then uses this array in the call to the Decimal(Int32, Int32, Int32, Boolean, Byte) constructor to instantiate a new Decimal value.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

.NET for Windows Store apps

Supported in: Windows 8

Supported in: Windows Phone 8.1

Supported in: Windows Phone Silverlight 8.1

Supported in: Windows Phone Silverlight 8

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft