Decimal 结构

定义

表示十进制浮点数。

public value class System::Decimal : IComparable, IComparable<System::Decimal>, IConvertible, IEquatable<System::Decimal>, IFormattable
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, 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, 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<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 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 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 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
    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 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, 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 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 IComparable<TSelf> IEquatable<TSelf> IParsable<Decimal> IParsable<TSelf> ISpanFormattable ISpanParsable<Decimal> ISpanParsable<TSelf> IUtf8SpanFormattable IUtf8SpanParsable<Decimal> IUtf8SpanParsable<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> IDeserializationCallback ISerializable

注解

有关此 API 的详细信息,请参阅 Decimal 的补充 API 备注

构造函数

名称 说明
Decimal(Double)

初始化指定双精度浮点数的值的新实例 Decimal

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

从指定实例构成部分的参数初始化新实例 Decimal

Decimal(Int32)

将指定的 32 位有符号整数的值初始化一个新实例 Decimal

Decimal(Int32[])

初始化以二进制形式表示且包含在指定数组中的十进制值的新实例 Decimal

Decimal(Int64)

初始化指定 64 位带符号整数的值的新实例 Decimal

Decimal(ReadOnlySpan<Int32>)

初始化以二进制形式表示且包含在指定范围中的十进制值的新实例 Decimal

Decimal(Single)

初始化指定单精度浮点数的值的新实例 Decimal

Decimal(UInt32)

初始化指定 32 位无符号整数的值的新实例 Decimal

Decimal(UInt64)

初始化指定 64 位无符号整数的值的新实例 Decimal

字段

名称 说明
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)

将此实例与指定的对象进行比较,并返回其相对值的比较。

ConvertToInteger<TInteger>(Decimal)

使用溢出时饱和度将值转换为指定的整数类型

ConvertToIntegerNative<TInteger>(Decimal)

使用特定于平台的行为在溢出时将值转换为指定的整数类型。

CopySign(Decimal, Decimal)

将值的符号复制到另一个值的符号。

CreateChecked<TOther>(TOther)

从值创建当前类型的实例,为超出当前类型的可表示范围的任何值引发溢出异常。

CreateSaturating<TOther>(TOther)

从值创建当前类型的实例,使属于当前类型的可表示范围之外的任何值饱和。

CreateTruncating<TOther>(TOther)

从值创建当前类型的实例,截断属于当前类型的可表示范围之外的任何值。

Divide(Decimal, Decimal)

除以两个指定 Decimal 值。

Equals(Decimal, Decimal)

返回一个值,该值指示两个指定的实例 Decimal 是否表示相同的值。

Equals(Decimal)

返回一个值,该值指示此实例和指定的 Decimal 对象是否表示相同的值。

Equals(Object)

返回一个值,该值指示此实例和指定的 Object 实例是否表示相同的类型和值。

Floor(Decimal)

将指定的 Decimal 数字舍入到最接近负无穷大的数字。

FromOACurrency(Int64)

将包含 OLE 自动化货币值的指定 64 位有符号整数转换为等效 Decimal 值。

GetBits(Decimal, Span<Int32>)

将指定实例的值转换为其等效的 Decimal 二进制表示形式。

GetBits(Decimal)

将指定实例的值转换为其等效的 Decimal 二进制表示形式。

GetHashCode()

返回此实例的哈希代码。

GetTypeCode()

返回 TypeCode 值类型的 Decimal值 。

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, IFormatProvider)

使用指定的区域性特定格式信息将数字的字符串表示形式转换为其 Decimal 等效形式。

Parse(String, NumberStyles, IFormatProvider)

使用指定的样式和区域性特定格式将数字的字符串表示形式转换为等效 Decimal 的字符串表示形式。

Parse(String, NumberStyles)

将指定样式中的数字的字符串表示形式转换为其 Decimal 等效形式。

Parse(String)

将数字的字符串表示形式转换为其 Decimal 等效形式。

Remainder(Decimal, Decimal)

计算除法两 Decimal 个值后的余数。

Round(Decimal, Int32, MidpointRounding)

使用指定的舍入策略将十进制值舍入到指定的精度。

Round(Decimal, Int32)

Decimal 值舍入为指定的小数位数。

Round(Decimal, MidpointRounding)

使用指定的舍入策略将十进制值舍入为整数。

Round(Decimal)

将十进制值舍入为最接近的整数。

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, IFormatProvider)

使用指定的格式和区域性特定的格式信息将此实例的数值转换为其等效的字符串表示形式。

ToString(String)

使用指定的格式将此实例的数值转换为其等效的字符串表示形式。

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)

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

Explicit(Decimal to Char)

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

Explicit(Decimal to Double)

定义对双精度浮点数的 Decimal 显式转换。

Explicit(Decimal to Int16)

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

Explicit(Decimal to Int32)

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

Explicit(Decimal to Int64)

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

Explicit(Decimal to SByte)

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

此 API 不符合 CLS。

Explicit(Decimal to Single)

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

Explicit(Decimal to UInt16)

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

此 API 不符合 CLS。

Explicit(Decimal to UInt32)

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

此 API 不符合 CLS。

Explicit(Decimal to UInt64)

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

此 API 不符合 CLS。

Explicit(Double to Decimal)

定义双精度浮点数到 a Decimal的显式转换。

Explicit(Single to Decimal)

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

GreaterThan(Decimal, Decimal)

返回一个值,该值指示指定的 Decimal 值是否大于另一个指定的 Decimal值。

GreaterThanOrEqual(Decimal, Decimal)

返回一个值,该值指示指定的 Decimal 值是否大于或等于另一个指定的 Decimal值。

Implicit(Byte to Decimal)

定义 8 位无符号整数到 a Decimal.

Implicit(Char to Decimal)

定义 Unicode 字符到 /> 的隐式转换。

Implicit(Int16 to Decimal)

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

Implicit(Int32 to Decimal)

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

Implicit(Int64 to Decimal)

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

Implicit(SByte to Decimal)

定义 8 位有符号整数到 a Decimal的隐式转换。

此 API 不符合 CLS。

Implicit(UInt16 to Decimal)

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

此 API 不符合 CLS。

Implicit(UInt32 to Decimal)

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

此 API 不符合 CLS。

Implicit(UInt64 to Decimal)

定义 64 位无符号整数到 a 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)

尝试将当前指数(采用 big-endian 格式)写入给定范围。

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

尝试将当前指数(以小端格式)写入给定范围。

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

尝试将当前符号(采用 big-endian 格式)写入给定范围。

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>.MultiplyAddEstimate(Decimal, Decimal, Decimal)

计算估计值 (left * right) + 。 addend

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

适用于

线程安全性

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

另请参阅