DecimalExpression<T extends Decimal?> extension

Exact decimal arithmetic using the selected database's capabilities.

on

Methods

average({required int scale, DecimalRounding rounding = DecimalRounding.exact}) Expr<Decimal?>

Available on Expr<T>, provided by the DecimalExpression extension

Averages non-null inputs, rounding once at the requested result scale. Empty/all-null input returns null; the default rejects lost digits.
constrained(int precision, int scale) Expr<T>

Available on Expr<T>, provided by the DecimalExpression extension

Rounds and checks a decimal against the requested precision and scale.
divide(Decimal divisor, {required int scale, DecimalRounding rounding = DecimalRounding.exact}) Expr<T>

Available on Expr<T>, provided by the DecimalExpression extension

Divides in SQL to an explicit scale without a floating-point intermediate.
divideExpression(Expr<Decimal?> divisor, {required int scale, DecimalRounding rounding = DecimalRounding.exact}) Expr<Decimal?>

Available on Expr<T>, provided by the DecimalExpression extension

Divides two SQL expressions. A null operand produces null.
minus(Decimal n) Expr<T>

Available on Expr<T>, provided by the DecimalExpression extension

Subtracts an exactly encoded decimal value.
minusExpression(Expr<Decimal?> other) Expr<Decimal?>

Available on Expr<T>, provided by the DecimalExpression extension

Subtracts another decimal SQL expression.
plus(Decimal n) Expr<T>

Available on Expr<T>, provided by the DecimalExpression extension

Adds an exactly encoded decimal value.
plusExpression(Expr<Decimal?> other) Expr<Decimal?>

Available on Expr<T>, provided by the DecimalExpression extension

Adds another decimal SQL expression.
rounded(int scale, {DecimalRounding rounding = DecimalRounding.exact}) Expr<T>

Available on Expr<T>, provided by the DecimalExpression extension

Rounds in SQL; DecimalRounding.exact rejects any lost nonzero digits.
sum({bool distinct = false}) Expr<Decimal?>

Available on Expr<T>, provided by the DecimalExpression extension

Sums decimal values exactly, returning null for an empty group.
times(Decimal n) Expr<T>

Available on Expr<T>, provided by the DecimalExpression extension

Multiplies by an exactly encoded decimal value.
timesExpression(Expr<Decimal?> other) Expr<Decimal?>

Available on Expr<T>, provided by the DecimalExpression extension

Multiplies by another decimal SQL expression.