Show / Hide Table of Contents

Class NumberType

XRPL Number type (serialized type code 9). Serialized as 12 bytes big-endian: 8 bytes — mantissa (signed int64, big-endian) 4 bytes — exponent (signed int32, big-endian) For non-zero values, mantissa is normalized to [10^18, long.MaxValue (2^63-1)]. Zero is represented as mantissa=0, exponent=Int32.MinValue (-2147483648). Exponent range: [-32768, 32768]. Used by Loan/LoanBroker fields (PrincipalRequested, DebtMaximum, etc.) per XLS-66. Encoding matches rippled Number class (include/xrpl/basics/Number.h).

Inheritance
object
NumberType
Implements
ISerializedType
Namespace: Xrpl.BinaryCodec.Types
Assembly: Xrpl.BinaryCodec.dll
Syntax
public class NumberType : ISerializedType

Constructors

| Edit this page View Source

NumberType(long, int)

Declaration
public NumberType(long mantissa, int exponent)
Parameters
Type Name Description
long mantissa
int exponent

Fields

| Edit this page View Source

Exponent

Declaration
public readonly int Exponent
Field Value
Type Description
int
| Edit this page View Source

Mantissa

Declaration
public readonly long Mantissa
Field Value
Type Description
long

Methods

| Edit this page View Source

FromJson(JsonNode)

Declaration
public static NumberType FromJson(JsonNode token)
Parameters
Type Name Description
JsonNode token
Returns
Type Description
NumberType
| Edit this page View Source

FromParser(BinaryParser, int?)

Declaration
public static NumberType FromParser(BinaryParser parser, int? hint = null)
Parameters
Type Name Description
BinaryParser parser
int? hint
Returns
Type Description
NumberType
| Edit this page View Source

FromString(string)

Parse a decimal string (e.g. "10000000000000", "0", "-500", "1e-32000") into the XRPL Number wire format. Uses BigInteger-based parsing to handle the full XRPL exponent range (±32768) which exceeds System.Decimal capacity. Normalizes mantissa to [10^18, long.MaxValue] per rippled Number class.

Declaration
public static NumberType FromString(string str)
Parameters
Type Name Description
string str
Returns
Type Description
NumberType
| Edit this page View Source

ToBytes(IBytesSink)

to bytes Sink

Declaration
public void ToBytes(IBytesSink sink)
Parameters
Type Name Description
IBytesSink sink

bytes Sink container

| Edit this page View Source

ToJson()

Get the JSON representation of this type

Declaration
public JsonNode ToJson()
Returns
Type Description
JsonNode
| Edit this page View Source

ToString()

Declaration
public override string ToString()
Returns
Type Description
string
Overrides
object.ToString()

Implements

ISerializedType

Extension Methods

StExtensions.ToDebuggedHex(ISerializedType)
StExtensions.ToHex(ISerializedType)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX