Decimal Struct

Definition

Represents a decimal floating-point number.

public value class System::Decimal : IComparable, IComparable<System::Decimal>, IConvertible, IEquatable<System::Decimal>, IFormattable
public value class System::Decimal : IComparable, IComparable<System::Decimal>, IConvertible, IEquatable<System::Decimal>, IFormattable, System::Runtime::Serialization::IDeserializationCallback, System::Runtime::Serialization::ISerializable
public value class System::Decimal : IComparable, IComparable<System::Decimal>, IConvertible, IEquatable<System::Decimal>, ISpanFormattable, System::Runtime::Serialization::IDeserializationCallback, System::Runtime::Serialization::ISerializable
public value class System::Decimal : IComparable<System::Decimal>, IConvertible, IEquatable<System::Decimal>, IParsable<System::Decimal>, ISpanParsable<System::Decimal>, System::Numerics::IAdditionOperators<System::Decimal, System::Decimal, System::Decimal>, System::Numerics::IAdditiveIdentity<System::Decimal, System::Decimal>, System::Numerics::IComparisonOperators<System::Decimal, System::Decimal, bool>, System::Numerics::IDecrementOperators<System::Decimal>, System::Numerics::IDivisionOperators<System::Decimal, System::Decimal, System::Decimal>, System::Numerics::IEqualityOperators<System::Decimal, System::Decimal, bool>, System::Numerics::IFloatingPoint<System::Decimal>, System::Numerics::IFloatingPointConstants<System::Decimal>, System::Numerics::IIncrementOperators<System::Decimal>, System::Numerics::IMinMaxValue<System::Decimal>, System::Numerics::IModulusOperators<System::Decimal, System::Decimal, System::Decimal>, System::Numerics::IMultiplicativeIdentity<System::Decimal, System::Decimal>, System::Numerics::IMultiplyOperators<System::Decimal, System::Decimal, System::Decimal>, System::Numerics::INumber<System::Decimal>, System::Numerics::INumberBase<System::Decimal>, System::Numerics::ISignedNumber<System::Decimal>, System::Numerics::ISubtractionOperators<System::Decimal, System::Decimal, System::Decimal>, System::Numerics::IUnaryNegationOperators<System::Decimal, System::Decimal>, System::Numerics::IUnaryPlusOperators<System::Decimal, System::Decimal>, System::Runtime::Serialization::IDeserializationCallback, System::Runtime::Serialization::ISerializable
public value class System::Decimal : IComparable<System::Decimal>, IConvertible, IEquatable<System::Decimal>, IParsable<System::Decimal>, ISpanParsable<System::Decimal>, IUtf8SpanParsable<System::Decimal>, System::Numerics::IAdditionOperators<System::Decimal, System::Decimal, System::Decimal>, System::Numerics::IAdditiveIdentity<System::Decimal, System::Decimal>, System::Numerics::IComparisonOperators<System::Decimal, System::Decimal, bool>, System::Numerics::IDecrementOperators<System::Decimal>, System::Numerics::IDivisionOperators<System::Decimal, System::Decimal, System::Decimal>, System::Numerics::IEqualityOperators<System::Decimal, System::Decimal, bool>, System::Numerics::IFloatingPoint<System::Decimal>, System::Numerics::IFloatingPointConstants<System::Decimal>, System::Numerics::IIncrementOperators<System::Decimal>, System::Numerics::IMinMaxValue<System::Decimal>, System::Numerics::IModulusOperators<System::Decimal, System::Decimal, System::Decimal>, System::Numerics::IMultiplicativeIdentity<System::Decimal, System::Decimal>, System::Numerics::IMultiplyOperators<System::Decimal, System::Decimal, System::Decimal>, System::Numerics::INumber<System::Decimal>, System::Numerics::INumberBase<System::Decimal>, System::Numerics::ISignedNumber<System::Decimal>, System::Numerics::ISubtractionOperators<System::Decimal, System::Decimal, System::Decimal>, System::Numerics::IUnaryNegationOperators<System::Decimal, System::Decimal>, System::Numerics::IUnaryPlusOperators<System::Decimal, System::Decimal>, System::Runtime::Serialization::IDeserializationCallback, System::Runtime::Serialization::ISerializable
public value class System::Decimal : IComparable, IComparable<System::Decimal>, IConvertible, IEquatable<System::Decimal>, IFormattable, System::Runtime::Serialization::IDeserializationCallback
public value class System::Decimal : IComparable, IConvertible, IFormattable
public value class System::Decimal : IComparable, IComparable<System::Decimal>, IEquatable<System::Decimal>, IFormattable
public struct Decimal : IComparable, IComparable<decimal>, IConvertible, IEquatable<decimal>, IFormattable
public readonly struct Decimal : IComparable, IComparable<decimal>, IConvertible, IEquatable<decimal>, IFormattable, System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable
public readonly struct Decimal : IComparable, IComparable<decimal>, IConvertible, IEquatable<decimal>, ISpanFormattable, System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable
public readonly struct Decimal : IComparable<decimal>, IConvertible, IEquatable<decimal>, IParsable<decimal>, ISpanParsable<decimal>, System.Numerics.IAdditionOperators<decimal,decimal,decimal>, System.Numerics.IAdditiveIdentity<decimal,decimal>, System.Numerics.IComparisonOperators<decimal,decimal,bool>, System.Numerics.IDecrementOperators<decimal>, System.Numerics.IDivisionOperators<decimal,decimal,decimal>, System.Numerics.IEqualityOperators<decimal,decimal,bool>, System.Numerics.IFloatingPoint<decimal>, System.Numerics.IFloatingPointConstants<decimal>, System.Numerics.IIncrementOperators<decimal>, System.Numerics.IMinMaxValue<decimal>, System.Numerics.IModulusOperators<decimal,decimal,decimal>, System.Numerics.IMultiplicativeIdentity<decimal,decimal>, System.Numerics.IMultiplyOperators<decimal,decimal,decimal>, System.Numerics.INumber<decimal>, System.Numerics.INumberBase<decimal>, System.Numerics.ISignedNumber<decimal>, System.Numerics.ISubtractionOperators<decimal,decimal,decimal>, System.Numerics.IUnaryNegationOperators<decimal,decimal>, System.Numerics.IUnaryPlusOperators<decimal,decimal>, System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable
public readonly struct Decimal : IComparable<decimal>, IConvertible, IEquatable<decimal>, IParsable<decimal>, ISpanParsable<decimal>, IUtf8SpanParsable<decimal>, System.Numerics.IAdditionOperators<decimal,decimal,decimal>, System.Numerics.IAdditiveIdentity<decimal,decimal>, System.Numerics.IComparisonOperators<decimal,decimal,bool>, System.Numerics.IDecrementOperators<decimal>, System.Numerics.IDivisionOperators<decimal,decimal,decimal>, System.Numerics.IEqualityOperators<decimal,decimal,bool>, System.Numerics.IFloatingPoint<decimal>, System.Numerics.IFloatingPointConstants<decimal>, System.Numerics.IIncrementOperators<decimal>, System.Numerics.IMinMaxValue<decimal>, System.Numerics.IModulusOperators<decimal,decimal,decimal>, System.Numerics.IMultiplicativeIdentity<decimal,decimal>, System.Numerics.IMultiplyOperators<decimal,decimal,decimal>, System.Numerics.INumber<decimal>, System.Numerics.INumberBase<decimal>, System.Numerics.ISignedNumber<decimal>, System.Numerics.ISubtractionOperators<decimal,decimal,decimal>, System.Numerics.IUnaryNegationOperators<decimal,decimal>, System.Numerics.IUnaryPlusOperators<decimal,decimal>, System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable
public struct Decimal : IComparable, IComparable<decimal>, IConvertible, IEquatable<decimal>, IFormattable, System.Runtime.Serialization.IDeserializationCallback
public readonly struct Decimal : IComparable, IComparable<decimal>, IConvertible, IEquatable<decimal>, IFormattable, System.Runtime.Serialization.IDeserializationCallback
[System.Serializable]
public struct Decimal : IComparable, IConvertible, IFormattable
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public struct Decimal : IComparable, IComparable<decimal>, IConvertible, IEquatable<decimal>, IFormattable
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public struct Decimal : IComparable, IComparable<decimal>, IConvertible, IEquatable<decimal>, IFormattable, System.Runtime.Serialization.IDeserializationCallback
public struct Decimal : IComparable, IComparable<decimal>, IEquatable<decimal>, IFormattable
type decimal = struct
    interface IConvertible
    interface IFormattable
type decimal = struct
    interface IConvertible
    interface IFormattable
    interface IDeserializationCallback
    interface ISerializable
type decimal = struct
    interface IConvertible
    interface ISpanFormattable
    interface IFormattable
    interface IDeserializationCallback
    interface ISerializable
type decimal = struct
    interface IConvertible
    interface IFormattable
    interface IParsable<decimal>
    interface ISpanFormattable
    interface ISpanParsable<decimal>
    interface IAdditionOperators<decimal, decimal, decimal>
    interface IAdditiveIdentity<decimal, decimal>
    interface IComparisonOperators<decimal, decimal, bool>
    interface IEqualityOperators<decimal, decimal, bool>
    interface IDecrementOperators<decimal>
    interface IDivisionOperators<decimal, decimal, decimal>
    interface IFloatingPoint<decimal>
    interface IFloatingPointConstants<decimal>
    interface INumberBase<decimal>
    interface IIncrementOperators<decimal>
    interface IMultiplicativeIdentity<decimal, decimal>
    interface IMultiplyOperators<decimal, decimal, decimal>
    interface ISubtractionOperators<decimal, decimal, decimal>
    interface IUnaryNegationOperators<decimal, decimal>
    interface IUnaryPlusOperators<decimal, decimal>
    interface IModulusOperators<decimal, decimal, decimal>
    interface INumber<decimal>
    interface ISignedNumber<decimal>
    interface IMinMaxValue<decimal>
    interface IDeserializationCallback
    interface ISerializable
type decimal = struct
    interface IConvertible
    interface IFormattable
    interface IParsable<decimal>
    interface ISpanFormattable
    interface ISpanParsable<decimal>
    interface IAdditionOperators<decimal, decimal, decimal>
    interface IAdditiveIdentity<decimal, decimal>
    interface IComparisonOperators<decimal, decimal, bool>
    interface IEqualityOperators<decimal, decimal, bool>
    interface IDecrementOperators<decimal>
    interface IDivisionOperators<decimal, decimal, decimal>
    interface IFloatingPoint<decimal>
    interface IFloatingPointConstants<decimal>
    interface INumberBase<decimal>
    interface IIncrementOperators<decimal>
    interface IMultiplicativeIdentity<decimal, decimal>
    interface IMultiplyOperators<decimal, decimal, decimal>
    interface ISubtractionOperators<decimal, decimal, decimal>
    interface IUnaryNegationOperators<decimal, decimal>
    interface IUnaryPlusOperators<decimal, decimal>
    interface IUtf8SpanFormattable
    interface IUtf8SpanParsable<decimal>
    interface IModulusOperators<decimal, decimal, decimal>
    interface INumber<decimal>
    interface ISignedNumber<decimal>
    interface IMinMaxValue<decimal>
    interface IDeserializationCallback
    interface ISerializable
type decimal = struct
    interface IConvertible
    interface IFormattable
    interface IParsable<decimal>
    interface ISpanFormattable
    interface ISpanParsable<decimal>
    interface IUtf8SpanFormattable
    interface IUtf8SpanParsable<decimal>
    interface IAdditionOperators<decimal, decimal, decimal>
    interface IAdditiveIdentity<decimal, decimal>
    interface IComparisonOperators<decimal, decimal, bool>
    interface IEqualityOperators<decimal, decimal, bool>
    interface IDecrementOperators<decimal>
    interface IDivisionOperators<decimal, decimal, decimal>
    interface IFloatingPoint<decimal>
    interface IFloatingPointConstants<decimal>
    interface IIncrementOperators<decimal>
    interface IMultiplicativeIdentity<decimal, decimal>
    interface IMultiplyOperators<decimal, decimal, decimal>
    interface INumberBase<decimal>
    interface ISubtractionOperators<decimal, decimal, decimal>
    interface IUnaryNegationOperators<decimal, decimal>
    interface IUnaryPlusOperators<decimal, decimal>
    interface IModulusOperators<decimal, decimal, decimal>
    interface INumber<decimal>
    interface ISignedNumber<decimal>
    interface IMinMaxValue<decimal>
    interface IDeserializationCallback
    interface ISerializable
type decimal = struct
    interface IConvertible
    interface IFormattable
    interface IDeserializationCallback
[<System.Serializable>]
type decimal = struct
    interface IFormattable
    interface IConvertible
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type decimal = struct
    interface IFormattable
    interface IConvertible
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type decimal = struct
    interface IFormattable
    interface IConvertible
    interface IDeserializationCallback
type decimal = struct
    interface IFormattable
Public Structure Decimal
Implements IComparable, IComparable(Of Decimal), IConvertible, IEquatable(Of Decimal), IFormattable
Public Structure Decimal
Implements IComparable, IComparable(Of Decimal), IConvertible, IDeserializationCallback, IEquatable(Of Decimal), IFormattable, ISerializable
Public Structure Decimal
Implements IComparable, IComparable(Of Decimal), IConvertible, IDeserializationCallback, IEquatable(Of Decimal), ISerializable, ISpanFormattable
Public Structure Decimal
Implements IAdditionOperators(Of Decimal, Decimal, Decimal), IAdditiveIdentity(Of Decimal, Decimal), IComparable(Of Decimal), IComparisonOperators(Of Decimal, Decimal, Boolean), IConvertible, IDecrementOperators(Of Decimal), IDeserializationCallback, IDivisionOperators(Of Decimal, Decimal, Decimal), IEqualityOperators(Of Decimal, Decimal, Boolean), IEquatable(Of Decimal), IFloatingPoint(Of Decimal), IFloatingPointConstants(Of Decimal), IIncrementOperators(Of Decimal), IMinMaxValue(Of Decimal), IModulusOperators(Of Decimal, Decimal, Decimal), IMultiplicativeIdentity(Of Decimal, Decimal), IMultiplyOperators(Of Decimal, Decimal, Decimal), INumber(Of Decimal), INumberBase(Of Decimal), IParsable(Of Decimal), ISerializable, ISignedNumber(Of Decimal), ISpanParsable(Of Decimal), ISubtractionOperators(Of Decimal, Decimal, Decimal), IUnaryNegationOperators(Of Decimal, Decimal), IUnaryPlusOperators(Of Decimal, Decimal)
Public Structure Decimal
Implements IAdditionOperators(Of Decimal, Decimal, Decimal), IAdditiveIdentity(Of Decimal, Decimal), IComparable(Of Decimal), IComparisonOperators(Of Decimal, Decimal, Boolean), IConvertible, IDecrementOperators(Of Decimal), IDeserializationCallback, IDivisionOperators(Of Decimal, Decimal, Decimal), IEqualityOperators(Of Decimal, Decimal, Boolean), IEquatable(Of Decimal), IFloatingPoint(Of Decimal), IFloatingPointConstants(Of Decimal), IIncrementOperators(Of Decimal), IMinMaxValue(Of Decimal), IModulusOperators(Of Decimal, Decimal, Decimal), IMultiplicativeIdentity(Of Decimal, Decimal), IMultiplyOperators(Of Decimal, Decimal, Decimal), INumber(Of Decimal), INumberBase(Of Decimal), IParsable(Of Decimal), ISerializable, ISignedNumber(Of Decimal), ISpanParsable(Of Decimal), ISubtractionOperators(Of Decimal, Decimal, Decimal), IUnaryNegationOperators(Of Decimal, Decimal), IUnaryPlusOperators(Of Decimal, Decimal), IUtf8SpanParsable(Of Decimal)
Public Structure Decimal
Implements IComparable, IComparable(Of Decimal), IConvertible, IDeserializationCallback, IEquatable(Of Decimal), IFormattable
Public Structure Decimal
Implements IComparable, IConvertible, IFormattable
Public Structure Decimal
Implements IComparable, IComparable(Of Decimal), IEquatable(Of Decimal), IFormattable
Inheritance
Decimal
Attributes
Implements
IComparable IComparable<Decimal> IConvertible IEquatable<Decimal> IFormattable IDeserializationCallback ISerializable ISpanFormattable IComparable<TSelf> IEquatable<TSelf> IParsable<Decimal> IParsable<TSelf> ISpanParsable<Decimal> ISpanParsable<TSelf> IAdditionOperators<Decimal,Decimal,Decimal> IAdditionOperators<TSelf,TSelf,TSelf> IAdditiveIdentity<Decimal,Decimal> IAdditiveIdentity<TSelf,TSelf> IComparisonOperators<Decimal,Decimal,Boolean> IComparisonOperators<TSelf,TSelf,Boolean> IDecrementOperators<Decimal> IDecrementOperators<TSelf> IDivisionOperators<Decimal,Decimal,Decimal> IDivisionOperators<TSelf,TSelf,TSelf> IEqualityOperators<Decimal,Decimal,Boolean> IEqualityOperators<TSelf,TOther,TResult> IEqualityOperators<TSelf,TSelf,Boolean> IFloatingPoint<Decimal> IFloatingPointConstants<Decimal> IFloatingPointConstants<TSelf> IIncrementOperators<Decimal> IIncrementOperators<TSelf> IMinMaxValue<Decimal> IModulusOperators<Decimal,Decimal,Decimal> IModulusOperators<TSelf,TSelf,TSelf> IMultiplicativeIdentity<Decimal,Decimal> IMultiplicativeIdentity<TSelf,TSelf> IMultiplyOperators<Decimal,Decimal,Decimal> IMultiplyOperators<TSelf,TSelf,TSelf> INumber<Decimal> INumber<TSelf> INumberBase<Decimal> INumberBase<TSelf> ISignedNumber<Decimal> ISignedNumber<TSelf> ISubtractionOperators<Decimal,Decimal,Decimal> ISubtractionOperators<TSelf,TSelf,TSelf> IUnaryNegationOperators<Decimal,Decimal> IUnaryNegationOperators<TSelf,TSelf> IUnaryPlusOperators<Decimal,Decimal> IUnaryPlusOperators<TSelf,TSelf> IUtf8SpanFormattable IUtf8SpanParsable<Decimal> IUtf8SpanParsable<TSelf>

Remarks

For more information about this API, see Supplemental API remarks for Decimal.

Constructors

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(Int32, Int32, Int32, Boolean, Byte)

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

Decimal(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(ReadOnlySpan<Int32>)

Initializes a new instance of Decimal to a decimal value represented in binary and contained in the specified span.

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.

Fields

MaxValue

Represents the largest possible value of Decimal. This field is constant and read-only.

MinusOne

Represents the number negative one (-1).

MinValue

Represents the smallest possible value of Decimal. This field is constant and read-only.

One

Represents the number one (1).

Zero

Represents the number zero (0).

Properties

Scale

Gets the scaling factor of the decimal, which is a number from 0 to 28 that represents the number of decimal digits.

Methods

Abs(Decimal)

Computes the absolute of a value.

Add(Decimal, Decimal)

Adds two specified Decimal values.

Ceiling(Decimal)

Returns the smallest integral value that is greater than or equal to the specified decimal number.

Clamp(Decimal, Decimal, Decimal)

Clamps a value to an inclusive minimum and maximum value.

Compare(Decimal, Decimal)

Compares two specified Decimal values.

CompareTo(Decimal)

Compares this instance to a specified Decimal object and returns a comparison of their relative values.

CompareTo(Object)

Compares this instance to a specified object and returns a comparison of their relative values.

ConvertToInteger<TInteger>(Decimal)

Converts a value to a specified integer type using saturation on overflow

ConvertToIntegerNative<TInteger>(Decimal)

Converts a value to a specified integer type using platform specific behavior on overflow.

CopySign(Decimal, Decimal)

Copies the sign of a value to the sign of another value.

CreateChecked<TOther>(TOther)

Creates an instance of the current type from a value, throwing an overflow exception for any values that fall outside the representable range of the current type.

CreateSaturating<TOther>(TOther)

Creates an instance of the current type from a value, saturating any values that fall outside the representable range of the current type.

CreateTruncating<TOther>(TOther)

Creates an instance of the current type from a value, truncating any values that fall outside the representable range of the current type.

Divide(Decimal, Decimal)

Divides two specified Decimal values.

Equals(Decimal)

Returns a value indicating whether this instance and a specified Decimal object represent the same value.

Equals(Decimal, Decimal)

Returns a value indicating whether two specified instances of Decimal represent the same value.

Equals(Object)

Returns a value indicating whether this instance and a specified Object represent the same type and value.

Floor(Decimal)

Rounds a specified Decimal number to the closest integer toward negative infinity.

FromOACurrency(Int64)

Converts the specified 64-bit signed integer, which contains an OLE Automation Currency value, to the equivalent Decimal value.

GetBits(Decimal)

Converts the value of a specified instance of Decimal to its equivalent binary representation.

GetBits(Decimal, Span<Int32>)

Converts the value of a specified instance of Decimal to its equivalent binary representation.

GetHashCode()

Returns the hash code for this instance.

GetTypeCode()

Returns the TypeCode for value type Decimal.

IsCanonical(Decimal)

Determines if a value is in its canonical representation.

IsEvenInteger(Decimal)

Determines if a value represents an even integral number.

IsInteger(Decimal)

Determines if a value represents an integral number.

IsNegative(Decimal)

Determines if a value is negative.

IsOddInteger(Decimal)

Determines if a value represents an odd integral number.

IsPositive(Decimal)

Determines if a value is positive.

Max(Decimal, Decimal)

Compares two values to compute which is greater.

MaxMagnitude(Decimal, Decimal)

Compares two values to compute which is greater.

Min(Decimal, Decimal)

Compares two values to compute which is lesser.

MinMagnitude(Decimal, Decimal)

Compares two values to compute which is lesser.

Multiply(Decimal, Decimal)

Multiplies two specified Decimal values.

Negate(Decimal)

Returns the result of multiplying the specified Decimal value by negative one.

Parse(ReadOnlySpan<Byte>, IFormatProvider)

Parses a span of UTF-8 characters into a value.

Parse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider)

Parses a span of UTF-8 characters into a value.

Parse(ReadOnlySpan<Char>, IFormatProvider)

Parses a span of characters into a value.

Parse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider)

Converts the span representation of a number to its Decimal equivalent using the specified style and culture-specific format.

Parse(String)

Converts the string representation of a number to its Decimal equivalent.

Parse(String, IFormatProvider)

Converts the string representation of a number to its Decimal equivalent using the specified culture-specific format information.

Parse(String, NumberStyles)

Converts the string representation of a number in a specified style to its Decimal equivalent.

Parse(String, NumberStyles, IFormatProvider)

Converts the string representation of a number to its Decimal equivalent using the specified style and culture-specific format.

Remainder(Decimal, Decimal)

Computes the remainder after dividing two Decimal values.

Round(Decimal)

Rounds a decimal value to the nearest integer.

Round(Decimal, Int32)

Rounds a Decimal value to a specified number of decimal places.

Round(Decimal, Int32, MidpointRounding)

Rounds a decimal value to the specified precision using the specified rounding strategy.

Round(Decimal, MidpointRounding)

Rounds a decimal value to an integer using the specified rounding strategy.

Sign(Decimal)

Computes the sign of a value.

Subtract(Decimal, Decimal)

Subtracts a specified Decimal value from another.

ToByte(Decimal)

Converts the value of the specified Decimal to the equivalent 8-bit unsigned integer.

ToDouble(Decimal)

Converts the value of the specified Decimal to the equivalent double-precision floating-point number.

ToInt16(Decimal)

Converts the value of the specified Decimal to the equivalent 16-bit signed integer.

ToInt32(Decimal)

Converts the value of the specified Decimal to the equivalent 32-bit signed integer.

ToInt64(Decimal)

Converts the value of the specified Decimal to the equivalent 64-bit signed integer.

ToOACurrency(Decimal)

Converts the specified Decimal value to the equivalent OLE Automation Currency value, which is contained in a 64-bit signed integer.

ToSByte(Decimal)

Converts the value of the specified Decimal to the equivalent 8-bit signed integer.

ToSingle(Decimal)

Converts the value of the specified Decimal to the equivalent single-precision floating-point number.

ToString()

Converts the numeric value of this instance to its equivalent string representation.

ToString(IFormatProvider)

Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information.

ToString(String)

Converts the numeric value of this instance to its equivalent string representation, using the specified format.

ToString(String, IFormatProvider)

Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific format information.

ToUInt16(Decimal)

Converts the value of the specified Decimal to the equivalent 16-bit unsigned integer.

ToUInt32(Decimal)

Converts the value of the specified Decimal to the equivalent 32-bit unsigned integer.

ToUInt64(Decimal)

Converts the value of the specified Decimal to the equivalent 64-bit unsigned integer.

Truncate(Decimal)

Returns the integral digits of the specified Decimal; any fractional digits are discarded.

TryFormat(Span<Byte>, Int32, ReadOnlySpan<Char>, IFormatProvider)

Tries to format the value of the current instance as UTF-8 into the provided span of bytes.

TryFormat(Span<Char>, Int32, ReadOnlySpan<Char>, IFormatProvider)

Tries to format the value of the current decimal instance into the provided span of characters.

TryGetBits(Decimal, Span<Int32>, Int32)

Tries to convert the value of a specified instance of Decimal to its equivalent binary representation.

TryParse(ReadOnlySpan<Byte>, Decimal)

Tries to convert a UTF-8 character span containing the string representation of a number to its signed decimal equivalent.

TryParse(ReadOnlySpan<Byte>, IFormatProvider, Decimal)

Tries to parse a span of UTF-8 characters into a value.

TryParse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider, Decimal)

Tries to parse a span of UTF-8 characters into a value.

TryParse(ReadOnlySpan<Char>, Decimal)

Converts the span representation of a number to its Decimal equivalent using the culture-specific format. A return value indicates whether the conversion succeeded or failed.

TryParse(ReadOnlySpan<Char>, IFormatProvider, Decimal)

Tries to parse a span of characters into a value.

TryParse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider, Decimal)

Converts the span representation of a number to its Decimal equivalent using the specified style and culture-specific format. A return value indicates whether the conversion succeeded or failed.

TryParse(String, Decimal)

Converts the string representation of a number to its Decimal equivalent. A return value indicates whether the conversion succeeded or failed.

TryParse(String, IFormatProvider, Decimal)

Tries to parse a string into a value.

TryParse(String, NumberStyles, IFormatProvider, Decimal)

Converts the string representation of a number to its Decimal equivalent using the specified style and culture-specific format. A return value indicates whether the conversion succeeded or failed.

Operators

Addition(Decimal, Decimal)

Adds two specified Decimal values.

Decrement(Decimal)

Decrements the Decimal operand by one.

Division(Decimal, Decimal)

Divides two specified Decimal values.

Equality(Decimal, Decimal)

Returns a value that indicates whether two Decimal values are equal.

Explicit(Decimal to Byte)

Defines an explicit conversion of a Decimal to an 8-bit unsigned integer.

Explicit(Decimal to Char)

Defines an explicit conversion of a Decimal to a Unicode character.

Explicit(Decimal to Double)

Defines an explicit conversion of a Decimal to a double-precision floating-point number.

Explicit(Decimal to Int16)

Defines an explicit conversion of a Decimal to a 16-bit signed integer.

Explicit(Decimal to Int32)

Defines an explicit conversion of a Decimal to a 32-bit signed integer.

Explicit(Decimal to Int64)

Defines an explicit conversion of a Decimal to a 64-bit signed integer.

Explicit(Decimal to SByte)

Defines an explicit conversion of a Decimal to an 8-bit signed integer.

This API is not CLS-compliant.

Explicit(Decimal to Single)

Defines an explicit conversion of a Decimal to a single-precision floating-point number.

Explicit(Decimal to UInt16)

Defines an explicit conversion of a Decimal to a 16-bit unsigned integer.

This API is not CLS-compliant.

Explicit(Decimal to UInt32)

Defines an explicit conversion of a Decimal to a 32-bit unsigned integer.

This API is not CLS-compliant.

Explicit(Decimal to UInt64)

Defines an explicit conversion of a Decimal to a 64-bit unsigned integer.

This API is not CLS-compliant.

Explicit(Double to Decimal)

Defines an explicit conversion of a double-precision floating-point number to a Decimal.

Explicit(Single to Decimal)

Defines an explicit conversion of a single-precision floating-point number to a Decimal.

GreaterThan(Decimal, Decimal)

Returns a value indicating whether a specified Decimal is greater than another specified Decimal.

GreaterThanOrEqual(Decimal, Decimal)

Returns a value indicating whether a specified Decimal is greater than or equal to another specified Decimal.

Implicit(Byte to Decimal)

Defines an implicit conversion of an 8-bit unsigned integer to a Decimal.

Implicit(Char to Decimal)

Defines an implicit conversion of a Unicode character to a Decimal.

Implicit(Int16 to Decimal)

Defines an implicit conversion of a 16-bit signed integer to a Decimal.

Implicit(Int32 to Decimal)

Defines an implicit conversion of a 32-bit signed integer to a Decimal.

Implicit(Int64 to Decimal)

Defines an implicit conversion of a 64-bit signed integer to a Decimal.

Implicit(SByte to Decimal)

Defines an implicit conversion of an 8-bit signed integer to a Decimal.

This API is not CLS-compliant.

Implicit(UInt16 to Decimal)

Defines an implicit conversion of a 16-bit unsigned integer to a Decimal.

This API is not CLS-compliant.

Implicit(UInt32 to Decimal)

Defines an implicit conversion of a 32-bit unsigned integer to a Decimal.

This API is not CLS-compliant.

Implicit(UInt64 to Decimal)

Defines an implicit conversion of a 64-bit unsigned integer to a Decimal.

This API is not CLS-compliant.

Increment(Decimal)

Increments the Decimal operand by 1.

Inequality(Decimal, Decimal)

Returns a value that indicates whether two Decimal objects have different values.

LessThan(Decimal, Decimal)

Returns a value indicating whether a specified Decimal is less than another specified Decimal.

LessThanOrEqual(Decimal, Decimal)

Returns a value indicating whether a specified Decimal is less than or equal to another specified Decimal.

Modulus(Decimal, Decimal)

Returns the remainder resulting from dividing two specified Decimal values.

Multiply(Decimal, Decimal)

Multiplies two specified Decimal values.

Subtraction(Decimal, Decimal)

Subtracts two specified Decimal values.

UnaryNegation(Decimal)

Negates the value of the specified Decimal operand.

UnaryPlus(Decimal)

Returns the value of the Decimal operand (the sign of the operand is unchanged).

Explicit Interface Implementations

IAdditiveIdentity<Decimal,Decimal>.AdditiveIdentity

Gets the additive identity of the current type.

IComparable.CompareTo(Object)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

IConvertible.GetTypeCode()

Returns the TypeCode for this instance.

IConvertible.ToBoolean(IFormatProvider)

For a description of this member, see ToBoolean(IFormatProvider).

IConvertible.ToByte(IFormatProvider)

For a description of this member, see ToByte(IFormatProvider).

IConvertible.ToChar(IFormatProvider)

This conversion is not supported. Attempting to use this method throws an InvalidCastException.

IConvertible.ToDateTime(IFormatProvider)

This conversion is not supported. Attempting to use this method throws an InvalidCastException.

IConvertible.ToDecimal(IFormatProvider)

For a description of this member, see ToDecimal(IFormatProvider).

IConvertible.ToDouble(IFormatProvider)

For a description of this member, see ToDouble(IFormatProvider).

IConvertible.ToInt16(IFormatProvider)

For a description of this member, see ToInt16(IFormatProvider).

IConvertible.ToInt32(IFormatProvider)

For a description of this member, see ToInt32(IFormatProvider).

IConvertible.ToInt64(IFormatProvider)

For a description of this member, see ToInt64(IFormatProvider).

IConvertible.ToSByte(IFormatProvider)

For a description of this member, see ToSByte(IFormatProvider).

IConvertible.ToSingle(IFormatProvider)

For a description of this member, see ToSingle(IFormatProvider).

IConvertible.ToType(Type, IFormatProvider)

For a description of this member, see ToType(Type, IFormatProvider).

IConvertible.ToUInt16(IFormatProvider)

For a description of this member, see ToUInt16(IFormatProvider).

IConvertible.ToUInt32(IFormatProvider)

For a description of this member, see ToInt32(IFormatProvider).

IConvertible.ToUInt64(IFormatProvider)

For a description of this member, see ToInt64(IFormatProvider).

IDeserializationCallback.OnDeserialization(Object)

Runs when the deserialization of an object has been completed.

IFloatingPoint<Decimal>.GetExponentByteCount()

Gets the number of bytes that will be written as part of TryWriteExponentLittleEndian(Span<Byte>, Int32).

IFloatingPoint<Decimal>.GetExponentShortestBitLength()

Gets the length, in bits, of the shortest two's complement representation of the current exponent.

IFloatingPoint<Decimal>.GetSignificandBitLength()

Gets the length, in bits, of the current significand.

IFloatingPoint<Decimal>.GetSignificandByteCount()

Gets the number of bytes that will be written as part of TryWriteSignificandLittleEndian(Span<Byte>, Int32).

IFloatingPoint<Decimal>.TryWriteExponentBigEndian(Span<Byte>, Int32)

Tries to write the current exponent, in big-endian format, to a given span.

IFloatingPoint<Decimal>.TryWriteExponentLittleEndian(Span<Byte>, Int32)

Tries to write the current exponent, in little-endian format, to a given span.

IFloatingPoint<Decimal>.TryWriteSignificandBigEndian(Span<Byte>, Int32)

Tries to write the current significand, in big-endian format, to a given span.

IFloatingPoint<Decimal>.TryWriteSignificandLittleEndian(Span<Byte>, Int32)

Tries to write the current significand, in little-endian format, to a given span.

IFloatingPointConstants<Decimal>.E

Gets the mathematical constant e.

IFloatingPointConstants<Decimal>.Pi

Gets the mathematical constant pi.

IFloatingPointConstants<Decimal>.Tau

Gets the mathematical constant tau.

IMinMaxValue<Decimal>.MaxValue

Gets the maximum value of the current type.

IMinMaxValue<Decimal>.MinValue

Gets the minimum value of the current type.

IMultiplicativeIdentity<Decimal,Decimal>.MultiplicativeIdentity

Gets the multiplicative identity of the current type.

INumber<Decimal>.MaxNumber(Decimal, Decimal)

Compares two values to compute which is greater and returning the other value if an input is NaN.

INumber<Decimal>.MinNumber(Decimal, Decimal)

Compares two values to compute which is lesser and returning the other value if an input is NaN.

INumberBase<Decimal>.IsComplexNumber(Decimal)

Determines if a value represents a complex number.

INumberBase<Decimal>.IsFinite(Decimal)

Determines if a value is finite.

INumberBase<Decimal>.IsImaginaryNumber(Decimal)

Determines if a value represents a pure imaginary number.

INumberBase<Decimal>.IsInfinity(Decimal)

Determines if a value is infinite.

INumberBase<Decimal>.IsNaN(Decimal)

Determines if a value is NaN.

INumberBase<Decimal>.IsNegativeInfinity(Decimal)

Determines if a value is negative infinity.

INumberBase<Decimal>.IsNormal(Decimal)

Determines if a value is normal.

INumberBase<Decimal>.IsPositiveInfinity(Decimal)

Determines if a value is positive infinity.

INumberBase<Decimal>.IsRealNumber(Decimal)

Determines if a value represents a real number.

INumberBase<Decimal>.IsSubnormal(Decimal)

Determines if a value is subnormal.

INumberBase<Decimal>.IsZero(Decimal)

Determines if a value is zero.

INumberBase<Decimal>.MaxMagnitudeNumber(Decimal, Decimal)

Compares two values to compute which has the greater magnitude and returning the other value if an input is NaN.

INumberBase<Decimal>.MinMagnitudeNumber(Decimal, Decimal)

Compares two values to compute which has the lesser magnitude and returning the other value if an input is NaN.

INumberBase<Decimal>.MultiplyAddEstimate(Decimal, Decimal, Decimal)

Computes an estimate of (left * right) + addend.

INumberBase<Decimal>.One

Gets the value 1 for the type.

INumberBase<Decimal>.Radix

Gets the radix, or base, for the type.

INumberBase<Decimal>.TryConvertFromChecked<TOther>(TOther, Decimal)
INumberBase<Decimal>.TryConvertFromSaturating<TOther>(TOther, Decimal)
INumberBase<Decimal>.TryConvertFromTruncating<TOther>(TOther, Decimal)
INumberBase<Decimal>.TryConvertToChecked<TOther>(Decimal, TOther)

Tries to convert an instance of the the current type to another type, throwing an overflow exception for any values that fall outside the representable range of the current type.

INumberBase<Decimal>.TryConvertToSaturating<TOther>(Decimal, TOther)

Tries to convert an instance of the the current type to another type, saturating any values that fall outside the representable range of the current type.

INumberBase<Decimal>.TryConvertToTruncating<TOther>(Decimal, TOther)

Tries to convert an instance of the the current type to another type, truncating any values that fall outside the representable range of the current type.

INumberBase<Decimal>.Zero

Gets the value 0 for the type.

ISerializable.GetObjectData(SerializationInfo, StreamingContext)

Populates a SerializationInfo with the data needed to serialize the target object.

ISignedNumber<Decimal>.NegativeOne

Gets the value -1 for the type.

Applies to

Thread Safety

All members of this type are thread safe. Members that appear to modify instance state actually return a new instance initialized with the new value. As with any other type, reading and writing to a shared variable that contains an instance of this type must be protected by a lock to guarantee thread safety.

See also