Decimal 結構

定義

代表十進位浮點數。

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
繼承
Decimal
屬性
實作
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>

備註

如需此 API 的詳細資訊,請參閱 小數點補充 API 備註

建構函式

Decimal(Double)

Decimal 的新執行個體初始化為指定雙精確度浮點數的值。

Decimal(Int32)

Decimal 的新執行個體初始化為指定 32 位元帶正負號整數的值。

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

從指定執行個體組成部分的參數,初始化 Decimal 的新執行個體。

Decimal(Int32[])

Decimal 的新執行個體初始化為以二進位表示並包含在指定陣列中的十進位值。

Decimal(Int64)

Decimal 的新執行個體初始化為指定 64 位元帶正負號整數的值。

Decimal(ReadOnlySpan<Int32>)

Decimal 的新執行個體初始化為十進位值,以二進位表示,並包含在指定範圍內。

Decimal(Single)

Decimal 的新執行個體初始化為指定單精確度浮點數的值。

Decimal(UInt32)

Decimal 的新執行個體初始化為指定 32 位元不帶正負號整數的值。

Decimal(UInt64)

Decimal 的新執行個體初始化為指定 64 位元不帶正負號整數的值。

欄位

MaxValue

代表 Decimal 最大的可能值。 這個欄位是不變且唯讀的。

MinusOne

表示數字負一 (-1)。

MinValue

代表 Decimal 最小的可能值。 這個欄位是不變且唯讀的。

One

表示數字一 (1)。

Zero

表示數字零 (0)。

屬性

Scale

取得小數的縮放比例,這是從 0 到 28 的數位,代表十進位數的數目。

方法

Abs(Decimal)

計算值的絕對值。

Add(Decimal, Decimal)

加入兩個指定的 Decimal 值。

Ceiling(Decimal)

傳回大於或等於指定之十進位數字的最小整數值。

Clamp(Decimal, Decimal, Decimal)

將值限製為內含最小值和最大值。

Compare(Decimal, Decimal)

比較兩個指定的 Decimal 值。

CompareTo(Decimal)

將這個執行個體與指定的 Decimal 物件相比較,並傳回其相對值的比較。

CompareTo(Object)

將這個執行個體與指定的物件相比較,並傳回它們相對值的比較。

CopySign(Decimal, Decimal)

將值的正負號複製到另一個值的正負號。

CreateChecked<TOther>(TOther)

從值建立目前類型的實例,針對落在目前類型可表示範圍以外的任何值擲回溢位例外狀況。

CreateSaturating<TOther>(TOther)

從值建立目前型別的實例,使落在目前類型可表示範圍以外的任何值飽和。

CreateTruncating<TOther>(TOther)

從值建立目前型別的實例,截斷落在目前類型可表示範圍以外的任何值。

Divide(Decimal, Decimal)

將兩個指定的 Decimal 值相除。

Equals(Decimal)

傳回值,該值表示這個執行個體和指定的 Decimal 物件是否代表相同值。

Equals(Decimal, Decimal)

傳回數值,指出 Decimal 的兩個指定執行個體是否表示相同的值。

Equals(Object)

傳回值,指出這個執行個體和指定的 Object 是否表示相同的類型和值。

Floor(Decimal)

將指定的 Decimal 數字往負無限大方向捨入為最接近的整數。

FromOACurrency(Int64)

將包含 OLE Automation 貨幣值的指定 64 位元帶正負號整數,轉換為對等的 Decimal 值。

GetBits(Decimal)

Decimal 的指定執行個體值轉換為其對等二進位表示。

GetBits(Decimal, Span<Int32>)

Decimal 的指定執行個體值轉換為其對等二進位表示。

GetHashCode()

傳回這個執行個體的雜湊碼。

GetTypeCode()

傳回實值類型 TypeCodeDecimal

IsCanonical(Decimal)

判斷值是否在其標準表示法中。

IsEvenInteger(Decimal)

判斷值是否代表偶數整數。

IsInteger(Decimal)

判斷值是否代表整數。

IsNegative(Decimal)

判斷值是否為負值。

IsOddInteger(Decimal)

判斷值是否代表奇數整數。

IsPositive(Decimal)

判斷值是否為正數。

Max(Decimal, Decimal)

比較兩個值與大於的計算。

MaxMagnitude(Decimal, Decimal)

比較兩個值與大於的計算。

Min(Decimal, Decimal)

比較兩個值與比較較少的計算。

MinMagnitude(Decimal, Decimal)

比較兩個值與比較較少的計算。

Multiply(Decimal, Decimal)

將兩個指定的 Decimal 值相乘。

Negate(Decimal)

傳回指定的 Decimal 值乘以負一的乘積。

Parse(ReadOnlySpan<Byte>, IFormatProvider)

將UTF-8字元的範圍剖析為值。

Parse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider)

將UTF-8字元的範圍剖析為值。

Parse(ReadOnlySpan<Char>, IFormatProvider)

將字元範圍剖析為值。

Parse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider)

使用指定樣式和特定文化特性格式,將數字的範圍表示轉換為其對等的 Decimal

Parse(String)

將數字的字串表示,轉換為其相等的 Decimal

Parse(String, IFormatProvider)

使用指定的特定文化特性格式資訊,將數字的字串表示轉換為其對等的 Decimal

Parse(String, NumberStyles)

將指定樣式中數字的字串表示轉換為其相等的 Decimal

Parse(String, NumberStyles, IFormatProvider)

使用指定的樣式和特定文化特性格式,將數字的字串表示轉換為其對等的 Decimal

Remainder(Decimal, Decimal)

計算將兩個 Decimal 值相除後的餘數。

Round(Decimal)

將十進位值四捨五入為最接近的整數。

Round(Decimal, Int32)

Decimal 值捨入為指定的小數位數。

Round(Decimal, Int32, MidpointRounding)

使用指定的捨入策略,將十進位值四捨五入至指定的有效位數。

Round(Decimal, MidpointRounding)

使用指定的進位策略,將十進位值四捨五入為整數。

Sign(Decimal)

計算值的符號。

Subtract(Decimal, Decimal)

將另一個值減去一個指定的 Decimal 值。

ToByte(Decimal)

將指定的 Decimal 值轉換為對等的 8 位元不帶正負號整數。

ToDouble(Decimal)

將指定的 Decimal 值轉換為對等的雙精確度浮點數。

ToInt16(Decimal)

將指定的 Decimal 值轉換為對等的 16 位元帶正負號整數。

ToInt32(Decimal)

將指定的 Decimal 值轉換為對等的 32 位元帶正負號整數。

ToInt64(Decimal)

將指定的 Decimal 值轉換為對等的 64 位元帶正負號整數。

ToOACurrency(Decimal)

將指定的 Decimal 值轉換為對等的 OLE Automation 貨幣值,這個值包含在 64 位元帶正負號的整數中。

ToSByte(Decimal)

將指定的 Decimal 值轉換為對等的 8 位元帶正負號整數。

ToSingle(Decimal)

將指定的 Decimal 值轉換為對等的單精確度浮點數。

ToString()

將這個執行個體的數值轉換為其相等字串表示。

ToString(IFormatProvider)

使用指定的特定文化特性格式資訊,將這個執行個體的數值轉換成它的相等字串表示。

ToString(String)

使用指定格式,將這個執行個體的數值轉換成它的相等字串表示。

ToString(String, IFormatProvider)

使用指定的格式和特定文化特性格式資訊,將這個執行個體的數值轉換成它的相等字串表示。

ToUInt16(Decimal)

將指定的 Decimal 值轉換為對等的 16 位元不帶正負號整數。

ToUInt32(Decimal)

將指定的 Decimal 值轉換為對等的 32 位元不帶正負號整數。

ToUInt64(Decimal)

將指定的 Decimal 值轉換為對等的 64 位元不帶正負號整數。

Truncate(Decimal)

傳回指定 Decimal 的整數數字;捨棄任何小數數字。

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

嘗試將目前實例的值格式化為UTF-8到提供的位元組範圍。

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

嘗試將目前十進位執行個體的值格式化為所提供的字元範圍。

TryGetBits(Decimal, Span<Int32>, Int32)

嘗試將 Decimal 其所指定執行個體值轉換為與其相等的二進位表示。

TryParse(ReadOnlySpan<Byte>, Decimal)

嘗試將包含數位字串表示的UTF-8字元範圍轉換為其帶正負號的十進位對等專案。

TryParse(ReadOnlySpan<Byte>, IFormatProvider, Decimal)

嘗試將UTF-8字元的範圍剖析為值。

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

嘗試將UTF-8字元的範圍剖析為值。

TryParse(ReadOnlySpan<Char>, Decimal)

使用指定樣式和特定文化特性格式,將數字的範圍表示轉換為其對等的 Decimal。 傳回值,該值指出轉換成功或失敗。

TryParse(ReadOnlySpan<Char>, IFormatProvider, Decimal)

嘗試將字元範圍剖析為值。

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

使用指定樣式和特定文化特性格式,將數字的範圍表示轉換為其對等的 Decimal。 傳回值,該值指出轉換成功或失敗。

TryParse(String, Decimal)

將數字的字串表示,轉換為其相等的 Decimal。 傳回值,該值指出轉換成功或失敗。

TryParse(String, IFormatProvider, Decimal)

嘗試將字串剖析成值。

TryParse(String, NumberStyles, IFormatProvider, Decimal)

使用指定的樣式和特定文化特性格式,將數字的字串表示轉換為其對等的 Decimal。 傳回值,該值指出轉換成功或失敗。

運算子

Addition(Decimal, Decimal)

加入兩個指定的 Decimal 值。

Decrement(Decimal)

Decimal 運算元減一。

Division(Decimal, Decimal)

將兩個指定的 Decimal 值相除。

Equality(Decimal, Decimal)

傳回值,指出兩個 Decimal 值是否相等。

Explicit(Decimal to Byte)

定義從 Decimal 到 8 位元不帶正負號整數的明確轉換。

Explicit(Decimal to Char)

定義從 Decimal 到 Unicode 字元的明確轉換。

Explicit(Decimal to Double)

定義從 Decimal 到雙精確度浮點數的明確轉換。

Explicit(Decimal to Int16)

定義從 Decimal 到 16 位元帶正負號整數的明確轉換。

Explicit(Decimal to Int32)

定義從 Decimal 到 32 位元帶正負號整數的明確轉換。

Explicit(Decimal to Int64)

定義從 Decimal 到 64 位元帶正負號整數的明確轉換。

Explicit(Decimal to SByte)

定義從 Decimal 到 8 位元帶正負號整數的明確轉換。

此應用程式開發介面不符合 CLS 標準。

Explicit(Decimal to Single)

定義從 Decimal 到單精確度浮點數的明確轉換。

Explicit(Decimal to UInt16)

定義從 Decimal 到 16 位元不帶正負號整數的明確轉換。

此應用程式開發介面不符合 CLS 標準。

Explicit(Decimal to UInt32)

定義從 Decimal 到 32 位元不帶正負號整數的明確轉換。

此應用程式開發介面不符合 CLS 標準。

Explicit(Decimal to UInt64)

定義從 Decimal 到 64 位元不帶正負號整數的明確轉換。

此應用程式開發介面不符合 CLS 標準。

Explicit(Double to Decimal)

定義從雙精確度浮點數到 Decimal 的明確轉換。

Explicit(Single to Decimal)

定義從單精確度浮點數到 Decimal 的明確轉換。

GreaterThan(Decimal, Decimal)

傳回值,指出所指定的 Decimal 是否大於另一個指定的 Decimal

GreaterThanOrEqual(Decimal, Decimal)

傳回值,指出所指定的 Decimal 是否大於或等於另一個指定的 Decimal

Implicit(Byte to Decimal)

定義從 8 位元不帶正負號整數到 Decimal 的隱含轉換。

Implicit(Char to Decimal)

定義從 Unicode 字元到 Decimal 的隱含轉換。

Implicit(Int16 to Decimal)

定義從 16 位元帶正負號的整數到 Decimal 的隱含轉換。

Implicit(Int32 to Decimal)

定義從 32 位元帶正負號的整數到 Decimal 的隱含轉換。

Implicit(Int64 to Decimal)

定義從 64 位元帶正負號的整數到 Decimal 的隱含轉換。

Implicit(SByte to Decimal)

定義從 8 位元帶正負號的整數到 Decimal 的隱含轉換。

此應用程式開發介面不符合 CLS 標準。

Implicit(UInt16 to Decimal)

定義從 16 位元不帶正負號的整數到 Decimal 的隱含轉換。

此應用程式開發介面不符合 CLS 標準。

Implicit(UInt32 to Decimal)

定義從 32 位元不帶正負號整數到 Decimal 的隱含轉換。

此應用程式開發介面不符合 CLS 標準。

Implicit(UInt64 to Decimal)

定義從 64 位元不帶正負號整數到 Decimal 的隱含轉換。

此應用程式開發介面不符合 CLS 標準。

Increment(Decimal)

Decimal 運算元加 1。

Inequality(Decimal, Decimal)

傳回值,指出兩個 Decimal 物件是否有不同的值。

LessThan(Decimal, Decimal)

傳回值,指出所指定的 Decimal 是否小於另一個指定的 Decimal

LessThanOrEqual(Decimal, Decimal)

傳回值,指出所指定的 Decimal 是否小於或等於另一個指定的 Decimal

Modulus(Decimal, Decimal)

傳回從兩個指定的 Decimal 值相除所得的餘數。

Multiply(Decimal, Decimal)

將兩個指定的 Decimal 值相乘。

Subtraction(Decimal, Decimal)

將兩個指定的 Decimal 值相減。

UnaryNegation(Decimal)

將指定的 Decimal 運算元值變換正負號。

UnaryPlus(Decimal)

傳回 Decimal 運算元的值 (運算元的正負號不變)。

明確介面實作

IAdditiveIdentity<Decimal,Decimal>.AdditiveIdentity

取得目前型別的加法識別。

IComparable.CompareTo(Object)

將目前的執行個體與相同類型的另一個物件相比較,並傳回整數,這個整數表示目前的執行個體在排序次序中,位於另一個物件之前、之後或相同位置。

IConvertible.GetTypeCode()

傳回這個執行個體的 TypeCode

IConvertible.ToBoolean(IFormatProvider)

如需這個成員的說明,請參閱 ToBoolean(IFormatProvider)

IConvertible.ToByte(IFormatProvider)

如需這個成員的說明,請參閱 ToByte(IFormatProvider)

IConvertible.ToChar(IFormatProvider)

不支援此轉換。 嘗試使用這個方法會擲回 InvalidCastException

IConvertible.ToDateTime(IFormatProvider)

不支援此轉換。 嘗試使用這個方法會擲回 InvalidCastException

IConvertible.ToDecimal(IFormatProvider)

如需這個成員的說明,請參閱 ToDecimal(IFormatProvider)

IConvertible.ToDouble(IFormatProvider)

如需這個成員的說明,請參閱 ToDouble(IFormatProvider)

IConvertible.ToInt16(IFormatProvider)

如需這個成員的說明,請參閱 ToInt16(IFormatProvider)

IConvertible.ToInt32(IFormatProvider)

如需這個成員的說明,請參閱 ToInt32(IFormatProvider)

IConvertible.ToInt64(IFormatProvider)

如需這個成員的說明,請參閱 ToInt64(IFormatProvider)

IConvertible.ToSByte(IFormatProvider)

如需這個成員的說明,請參閱 ToSByte(IFormatProvider)

IConvertible.ToSingle(IFormatProvider)

如需這個成員的說明,請參閱 ToSingle(IFormatProvider)

IConvertible.ToType(Type, IFormatProvider)

如需這個成員的說明,請參閱 ToType(Type, IFormatProvider)

IConvertible.ToUInt16(IFormatProvider)

如需這個成員的說明,請參閱 ToUInt16(IFormatProvider)

IConvertible.ToUInt32(IFormatProvider)

如需這個成員的說明,請參閱 ToInt32(IFormatProvider)

IConvertible.ToUInt64(IFormatProvider)

如需這個成員的說明,請參閱 ToInt64(IFormatProvider)

IDeserializationCallback.OnDeserialization(Object)

在物件完成還原序列化時執行。

IFloatingPoint<Decimal>.GetExponentByteCount()

取得將寫入為的 TryWriteExponentLittleEndian(Span<Byte>, Int32)位元元組數目。

IFloatingPoint<Decimal>.GetExponentShortestBitLength()

取得目前指數之最短兩個補碼表示法的長度,以位為單位。

IFloatingPoint<Decimal>.GetSignificandBitLength()

取得目前符號的長度,以位為單位。

IFloatingPoint<Decimal>.GetSignificandByteCount()

取得將寫入為的 TryWriteSignificandLittleEndian(Span<Byte>, Int32)位元元組數目。

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

嘗試將目前的指數以大到尾格式寫入指定的範圍。

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

嘗試以小到尾格式將目前的指數寫入指定的範圍。

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

嘗試以大端格式將目前的符號寫入指定的範圍。

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

嘗試以小到小到大的格式,將目前的符號寫入指定的範圍。

IFloatingPointConstants<Decimal>.E

取得數學常數 e

IFloatingPointConstants<Decimal>.Pi

取得數學常數 pi

IFloatingPointConstants<Decimal>.Tau

取得數學常數 tau

IMinMaxValue<Decimal>.MaxValue

取得目前型別的最大值。

IMinMaxValue<Decimal>.MinValue

取得目前型別的最小值。

IMultiplicativeIdentity<Decimal,Decimal>.MultiplicativeIdentity

取得目前型別的乘法識別。

INumber<Decimal>.MaxNumber(Decimal, Decimal)

比較兩個值與計算,如果輸入為 NaN,則會傳回另一個值。

INumber<Decimal>.MinNumber(Decimal, Decimal)

比較兩個值與計算,如果輸入 NaN為 ,則會傳回另一個值。

INumberBase<Decimal>.IsComplexNumber(Decimal)

判斷值是否代表複數。

INumberBase<Decimal>.IsFinite(Decimal)

判斷值是否有限。

INumberBase<Decimal>.IsImaginaryNumber(Decimal)

判斷值是否代表純虛數。

INumberBase<Decimal>.IsInfinity(Decimal)

判斷值是否為無限。

INumberBase<Decimal>.IsNaN(Decimal)

判斷值是否為 NaN。

INumberBase<Decimal>.IsNegativeInfinity(Decimal)

判斷值是否為負無限大。

INumberBase<Decimal>.IsNormal(Decimal)

判斷值是否正常。

INumberBase<Decimal>.IsPositiveInfinity(Decimal)

判斷值是否為正無限大。

INumberBase<Decimal>.IsRealNumber(Decimal)

判斷值是否代表實數。

INumberBase<Decimal>.IsSubnormal(Decimal)

判斷值是否為次正常。

INumberBase<Decimal>.IsZero(Decimal)

判斷值是否為零。

INumberBase<Decimal>.MaxMagnitudeNumber(Decimal, Decimal)

比較兩個值與具有較大大小的計算,如果輸入為 NaN,則會傳回另一個值。

INumberBase<Decimal>.MinMagnitudeNumber(Decimal, Decimal)

比較兩個值與計算,其大小較小,如果輸入為 NaN,則會傳回另一個值。

INumberBase<Decimal>.One

取得型別的值 1

INumberBase<Decimal>.Radix

取得類型的基數或基底。

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

代表十進位浮點數。

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

代表十進位浮點數。

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

代表十進位浮點數。

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

嘗試將目前類型的實例轉換成另一個類型,針對落在目前類型可表示範圍以外的任何值擲回溢位例外狀況。

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

嘗試將目前類型的實例轉換成另一種類型,使落在目前類型可表示範圍以外的任何值飽和。

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

嘗試將目前類型的實例轉換成另一個類型,截斷落在目前類型可表示範圍以外的任何值。

INumberBase<Decimal>.Zero

取得型別的值 0

ISerializable.GetObjectData(SerializationInfo, StreamingContext)

將序列化目標物件所需的資料填入 SerializationInfo

ISignedNumber<Decimal>.NegativeOne

取得型別的值 -1

適用於

執行緒安全性

此類型的所有成員都是安全線程。 看似修改實例狀態的成員,實際上會傳回以新值初始化的新實例。 如同任何其他類型,讀取和寫入包含此類型實例的共用變數必須受到鎖定保護,以確保線程安全。

另請參閱