API Reference › Decimal › Decimal.cmp
method

Decimal.cmp

Decimal.cmp(a, b) -> int

Compares two decimals regardless of their scales, returning -1, 0, or 1.

Example

program Demo {
  handler Step phase Update {
    if Decimal.cmp(balance, price) < 0 { deny() }
  }
}
← All symbols