pub fn balance_tolerance(
expected: Decimal,
explicit: Option<Decimal>,
tolerance_multiplier: Decimal,
) -> DecimalExpand description
Compute the tolerance to apply when comparing a balance assertion’s expected amount against the booked actual.
expected: the asserted amount from the balance directive.explicit: the~ tolerancefrom the directive, if any (always wins).tolerance_multiplier: the activeinferred_tolerance_multiplieroption (default 0.5; overridable viaoption "inferred_tolerance_multiplier" "...").
Mirrors the inline logic in validate_balance_late (private) so
out-of-pipeline consumers (currently the LSP code-lens path)
produce the same verdict as the validator without re-deriving the
rule from the Beancount spec.
Matches Python beancount: https://github.com/beancount/beancount/blob/master/beancount/ops/balance.py