Decimal Structure

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Represents a decimal number.

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

Syntax

```public struct Decimal
```

The Decimal type exposes the following members.

Constructors

NameDescription
Decimal(Double)Initializes a new instance of Decimal to the value of the specified double-precision floating-point number.
Decimal(Int32)Initializes a new instance of Decimal to the value of the specified 32-bit signed integer.
Decimal(array<Int32>[]()[][])Initializes a new instance of Decimal to a decimal value represented in binary and contained in a specified array.
Decimal(Int64)Initializes a new instance of Decimal to the value of the specified 64-bit signed integer.
Decimal(Single)Initializes a new instance of Decimal to the value of the specified single-precision floating-point number.
Decimal(UInt32)Initializes a new instance of Decimal to the value of the specified 32-bit unsigned integer.
Decimal(UInt64)Initializes a new instance of Decimal to the value of the specified 64-bit unsigned integer.
Decimal(Int32, Int32, Int32, Boolean, Byte)Initializes a new instance of Decimal from parameters specifying the instance's constituent parts.
Top

Methods

NameDescription
EqualsIndicates whether this instance and a specified object are equal. (Inherited from ValueType.)
GetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
GetTypeGets the Type of the current instance. (Inherited from Object.)
ToStringReturns a string that represents the current object. (Inherited from Object.)
Top

Remarks

The Decimal value type represents decimal numbers ranging from positive 79,228,162,514,264,337,593,543,950,335 to negative 79,228,162,514,264,337,593,543,950,335. The Decimal value type is appropriate for financial calculations requiring large numbers of significant integral and fractional digits and no round-off errors. The Decimal type does not eliminate the need for rounding. Rather, it minimizes errors due to rounding.

A decimal number is a floating-point value that consists of a sign, a numeric value where each digit in the value ranges from 0 to 9, and a scaling factor that indicates the position of a floating decimal point that separates the integral and fractional parts of the numeric value.