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:
1 parent
0fb19b4b25
commit
5ef5f47ebf
5 files changed
+17
-13
No files matched your search
@@ -135,7 +135,7 @@ pub fn tax_basis_csv(ledger: &Ledger, names: &[String], tc: &TaxCapital) -> Stri
|
||||
Some(t) => [
|
||||
money(book),
|
||||
money(t),
|
||||
money(book - t),
|
||||
money(ledger_core::money::sub_in_range(book, t)),
|
||||
"tax basis".into(),
|
||||
note,
|
||||
],
|
||||
@@ -244,7 +244,7 @@ pub fn tax_basis_csv(ledger: &Ledger, names: &[String], tc: &TaxCapital) -> Stri
|
||||
name,
|
||||
"Reconciliation: less property distributed, at book",
|
||||
recon(
|
||||
Some(-r.property_distributed),
|
||||
Some(ledger_core::money::neg(r.property_distributed)),
|
||||
"the company's adjusted tax basis in it is the CPA's",
|
||||
),
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user