Table of Contents

Struct BigDecimal

Namespace
Apache.Ignite
Assembly
Apache.Ignite.dll

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

value decimal

Decimal value.

BigDecimal(BigInteger, short)

Initializes a new instance of the BigDecimal struct.

public BigDecimal(BigInteger unscaledValue, short scale)

Parameters

unscaledValue BigInteger

Unscaled value.

scale short

Scale.

Properties

Scale

Gets the scale.

public short Scale { get; }

Property Value

short

UnscaledValue

Gets the unscaled value.

public BigInteger UnscaledValue { get; }

Property Value

BigInteger

Methods

CompareTo(BigDecimal)

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.

public int CompareTo(BigDecimal other)

Parameters

other BigDecimal

An object to compare with this instance.

Returns

int

A value that indicates the relative order of the objects being compared. The return value has these meanings:

Value Meaning
Less than zero This instance precedes other in the sort order.
Zero This instance occurs in the same position in the sort order as other.
Greater than zero This instance follows other in the sort order.

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.

public int CompareTo(object? obj)

Parameters

obj object

An object to compare with this instance.

Returns

int

A value that indicates the relative order of the objects being compared. The return value has these meanings:

Value Meaning
Less than zero This instance precedes obj in the sort order.
Zero This instance occurs in the same position in the sort order as obj.
Greater than zero This instance follows obj in the sort order.

Exceptions

ArgumentException

obj is not the same type as this instance.

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()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

ToString(IFormatProvider?)

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

public string ToString(IFormatProvider? provider)

Parameters

provider IFormatProvider

An object that supplies culture-specific formatting information.

Returns

string

The string representation of the current value.

ToString(string?, IFormatProvider?)

Formats the value of the current instance using the specified format.

public string ToString(string? format, IFormatProvider? formatProvider)

Parameters

format string

The format to use.

-or-

A null reference (Nothing in Visual Basic) to use the default format defined for the type of the IFormattable implementation.

formatProvider IFormatProvider

The provider to use to format the value.

-or-

A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.

Returns

string

The value of the current instance in the specified format.

Operators

operator >(BigDecimal, BigDecimal)

public static bool operator >(BigDecimal left, BigDecimal right)

Parameters

left BigDecimal
right BigDecimal

Returns

bool

operator >=(BigDecimal, BigDecimal)

public static bool operator >=(BigDecimal left, BigDecimal right)

Parameters

left BigDecimal
right BigDecimal

Returns

bool

operator <(BigDecimal, BigDecimal)

public static bool operator <(BigDecimal left, BigDecimal right)

Parameters

left BigDecimal
right BigDecimal

Returns

bool

operator <=(BigDecimal, BigDecimal)

public static bool operator <=(BigDecimal left, BigDecimal right)

Parameters

left BigDecimal
right BigDecimal

Returns

bool