scauligi / refried

A collection of plugins and scripts for beancount and fava.
GNU General Public License v3.0
42 stars 7 forks source link

Balance check respects tolerances #8

Closed hunner closed 2 years ago

hunner commented 2 years ago

I was monthly-budgeting for annual expenses with (-14.99 / 12) USD etc. and ended up with this humorous floating point math error: On-budget accounts and budget total do not match: (54321.71 USD) vs (54321.71000000000000000000002 USD). I had tolerances configured to accept this difference, but the rebudged plugin didn't take tolerances into account.

This change makes balance_check only raise the error when the difference exceeds the tolerances.

By default the tolerances are still zero, so this code will still raise the error until the user changes the default tolerances option via option "inferred_tolerance_default" "USD:0.001" or option "inferred_tolerance_default" "*:0.001"