API Reference › Decimal › Decimal.add
method

Decimal.add

Decimal.add(a, b) -> Decimal

Returns the exact sum, aligning the two scales first so nothing is rounded. 0.10 + 0.20 is exactly 0.30.

Example

program Demo {
  handler Step phase Update {
    let total = Decimal.add(subtotal, tax)
  }
}
← All symbols