Struct BigDecimal
Big decimal.
Ignite supports values with up to MaxValue precision (in tables, SQL, Compute, and other APIs). .NET decimal has 28-29 digit precision and can not represent all values that Ignite supports. This type fills the gap.
public readonly record struct BigDecimal : IComparable<BigDecimal>, IComparable, IFormattable, IEquatable<BigDecimal>
- Implements
- Inherited Members
Constructors
BigDecimal(decimal)
Initializes a new instance of the BigDecimal struct.
public BigDecimal(decimal value)
Parameters
valuedecimalDecimal value.
BigDecimal(BigInteger, short)
Initializes a new instance of the BigDecimal struct.
public BigDecimal(BigInteger unscaledValue, short scale)
Parameters
unscaledValueBigIntegerUnscaled value.
scaleshortScale.
Properties
Scale
Gets the scale.
public short Scale { get; }
Property Value
UnscaledValue
Gets the unscaled value.
public BigInteger UnscaledValue { get; }
Property Value
Methods
CompareTo(BigDecimal)
public int CompareTo(BigDecimal other)
Parameters
otherBigDecimal
Returns
CompareTo(object?)
public int CompareTo(object? obj)
Parameters
objobject
Returns
ToDecimal()
Converts the value of this instance to its equivalent decimal representation.
public decimal ToDecimal()
Returns
- decimal
Decimal representation of the current value.
Exceptions
- OverflowException
Value was either too large or too small for a Decimal.
ToString()
public override string ToString()
Returns
ToString(IFormatProvider?)
Converts the numeric value of this object to its equivalent string representation.
public string ToString(IFormatProvider? provider)
Parameters
providerIFormatProviderAn object that supplies culture-specific formatting information.
Returns
- string
The string representation of the current value.
ToString(string?, IFormatProvider?)
public string ToString(string? format, IFormatProvider? formatProvider)
Parameters
formatstringformatProviderIFormatProvider
Returns
Operators
operator >(BigDecimal, BigDecimal)
public static bool operator >(BigDecimal left, BigDecimal right)
Parameters
leftBigDecimalrightBigDecimal
Returns
operator >=(BigDecimal, BigDecimal)
public static bool operator >=(BigDecimal left, BigDecimal right)
Parameters
leftBigDecimalrightBigDecimal
Returns
operator <(BigDecimal, BigDecimal)
public static bool operator <(BigDecimal left, BigDecimal right)
Parameters
leftBigDecimalrightBigDecimal
Returns
operator <=(BigDecimal, BigDecimal)
public static bool operator <=(BigDecimal left, BigDecimal right)
Parameters
leftBigDecimalrightBigDecimal