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 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 的详细信息,请参阅 Decimal 的补充 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)

将指定的 64 位有符号整数(它包含 OLE 自动化货币值)转换为等效的 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 值乘以 -1 的结果。

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 自动化货币值,该值包含在一个 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 操作数减 1。

Division(Decimal, Decimal)

将两个指定的 Decimal 值相除。

Equality(Decimal, Decimal)

返回一个值,该值指示两个 Decimal 值是否相等。

Explicit(Decimal to Byte)

定义从 Decimal 到 8 位无符号整数的显式转换。

Explicit(Decimal to Char)

定义从 Unicode 字符到 Decimal 的显式转换。

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 位有符号整数的显式转换。

此 API 不兼容 CLS。

Explicit(Decimal to Single)

定义从 Decimal 到单精度浮点数的显式转换。

Explicit(Decimal to UInt16)

定义从 Decimal 到 16 位无符号整数的显式转换。

此 API 不兼容 CLS。

Explicit(Decimal to UInt32)

定义从 Decimal 到 32 位无符号整数的显式转换。

此 API 不兼容 CLS。

Explicit(Decimal to UInt64)

定义从 Decimal 到 64 位无符号整数的显式转换。

此 API 不兼容 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 值的隐式转换。

此 API 不兼容 CLS。

Implicit(UInt16 to Decimal)

定义从 16 位无符号整数到 Decimal 的隐式转换。

此 API 不兼容 CLS。

Implicit(UInt32 to Decimal)

定义从 32 位无符号整数到 Decimal 的隐式转换。

此 API 不兼容 CLS。

Implicit(UInt64 to Decimal)

定义从 64 位无符号整数到 Decimal 的隐式转换。

此 API 不兼容 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)

尝试以 little endian 格式将当前指数写入给定范围。

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

尝试以 big-endian 格式将当前有效值写入给定范围。

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

尝试以 little-endian 格式将当前有效值写入给定范围。

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

适用于

线程安全性

此类型的所有成员都是线程安全的。 看起来修改实例状态的成员实际上返回使用新值初始化的新实例。 与任何其他类型一样,读取和写入包含此类型的实例的共享变量必须受到锁的保护,以确保线程安全。

另请参阅