Expand description
Strict decimal ↔ scaled-integer codecs.
Constants§
- INT64_
MAX - INT64_
MIN - LEDGER_
SCALE - MAX_
PROTOCOL_ SCALE - Maximum accepted quantity/ledger scale for public formatters and catalog hydration.
- PRICE_
TICK_ SCALE - UINT64_
MAX
Functions§
- decimal_
to_ scaled - decimal_
to_ scaled_ str - format_
id - format_
ledger_ u64 - Format a smaller ledger quantity integer by
10^scale. - format_
ledger_ u128 - Format a full-width unsigned ledger integer string by
10^scale. - format_
price_ ticks - format_
qty_ scaled - format_
uint64_ id - Format a uint64 id as base58, or
"0"when zero (order/trade ids). - i128_
to_ u128 - Encode a non-negative scaled integer as protobuf
U128(hi/lo). - id_
to_ u64 - Parse a public id that may be base58 or decimal.
- parse_
decimal_ input - parse_
price_ ticks - parse_
price_ ticks_ str - parse_
qty_ scaled - parse_
qty_ scaled_ str - try_
decimal_ to_ scaled - Strict decimal→scaled. Never rounds; excess fractional digits fail.
- u128_
to_ proto - Encode a
u128as protobufU128(hi/lo). - u128_
to_ str - Format protobuf U128 hi/lo as a decimal string.
- validate_
protocol_ scale - Validate a caller/catalog scale before padding or allocation.