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)

'Declaration
Public Structure Decimal

The Decimal type exposes the following members.

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

  NameDescription
Public methodEqualsIndicates whether this instance and a specified object are equal. (Inherited from ValueType.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

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.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show: