Show / Hide Table of Contents

Class NumberContext

The rules an XrplNumber operation follows: the mantissa scale and the rounding mode. rippled keeps both in thread-local state switched by guards; here they are an explicit argument, so a result never depends on what another piece of code set before.

Inheritance
object
NumberContext
Namespace: Xrpl.BinaryCodec.Numbers
Assembly: Xrpl.BinaryCodec.dll
Syntax
public sealed class NumberContext

Properties

| Edit this page View Source

Default

The newest rules - Large330 - rounding to nearest.

Declaration
public static NumberContext Default { get; }
Property Value
Type Description
NumberContext
| Edit this page View Source

Rounding

The rounding mode.

Declaration
public NumberRounding Rounding { get; }
Property Value
Type Description
NumberRounding
| Edit this page View Source

Scale

The mantissa scale.

Declaration
public NumberMantissaScale Scale { get; }
Property Value
Type Description
NumberMantissaScale

Methods

| Edit this page View Source

Create(NumberMantissaScale, NumberRounding)

Creates a context for a scale and a rounding mode.

Declaration
public static NumberContext Create(NumberMantissaScale scale, NumberRounding rounding = NumberRounding.ToNearest)
Parameters
Type Name Description
NumberMantissaScale scale
NumberRounding rounding
Returns
Type Description
NumberContext
| Edit this page View Source

ForAmendments(bool, bool, bool)

The context rippled uses for a ledger with these amendments, rounding to nearest.

Declaration
public static NumberContext ForAmendments(bool largeNumbers, bool fixCleanup320, bool fixCleanup330)
Parameters
Type Name Description
bool largeNumbers

Whether SingleAssetVault or LendingProtocol is enabled.

bool fixCleanup320

Whether fixCleanup3_2_0 is enabled.

bool fixCleanup330

Whether fixCleanup3_3_0 is enabled.

Returns
Type Description
NumberContext
| Edit this page View Source

ToString()

Declaration
public override string ToString()
Returns
Type Description
string
Overrides
object.ToString()
| Edit this page View Source

WithRounding(NumberRounding)

The same scale with another rounding mode.

Declaration
public NumberContext WithRounding(NumberRounding rounding)
Parameters
Type Name Description
NumberRounding rounding
Returns
Type Description
NumberContext
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX