Skip to content

@lang:num.parse

Parse ordinary decimal notation into base units with explicit rounding and signedness.

On-chain (@lang:num.parse!): Parse live decimal strings; precision must be 0–77. Rounding and signedness are constant options.

Returns: number

@lang:num.parse(value decimals rounding? signedness?)
NameTypeDescription
valuestring | numberInput decimal string
decimalsnumberDecimal precision (0–77)
[rounding]stringtrunc (default), floor, or ceil
[signedness]stringsigned (default) or unsigned

The on-chain face uses Operations decimal conversions. Precision is 0–77. Parsing accepts ordinary decimal notation, including .5, 1., and a leading plus sign; it rejects spaces, exponents and separators. Optional rounding is trunc (default), floor, or ceil; optional signedness is signed (default) or unsigned. Unsigned parsing rejects a minus sign, including -0. Formatting emits ordinary decimal notation and removes trailing fractional zeros. Integer range and rounding behavior match off-chain evaluation.