refactor(package): Decimal arithmetic goes through the kernel (K-U12)

The raw-decimal-arith detector counted 13 places in ledger-package
before and counts 0 after. No figure changes.

Negations go through money::neg; the two differences of books figures
(attention, k1_tax) through sub_in_range; the checked sums in the
attention checks through Amount::checked_add / checked_sub with their
"cannot compute" handling untouched.

Not a plain sum or sign: text.rs padded a number to two places with
rescale (which rounds when 96 bits do not hold the padded digits); it
now uses rescale_exact and keeps the number as it was if padding would
round, so the printed text never rounds.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude committed 2026-11-09 23:57:22 -07:00
1 parent 0fb19b4b25
commit 5ef5f47ebf
5 files changed
+17 -13

No files matched your search

+1 -1
View File
@@ -269,7 +269,7 @@ pub fn invoice_document(
{
label.push_str(&format!(" · ref {r}"));
}
settled.push((label, -l.amount));
settled.push((label, ledger_core::money::neg(l.amount)));
last_paid = Some(l.date);
}
for (label, amount) in [