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() }
}
}Decimal.cmp(a, b) -> int
Compares two decimals regardless of their scales, returning -1, 0, or 1.
program Demo {
handler Step phase Update {
if Decimal.cmp(balance, price) < 0 { deny() }
}
}