Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support rounding postings with arithmetic #795

Open
maxheld83 opened this issue Dec 12, 2023 · 2 comments
Open

support rounding postings with arithmetic #795

maxheld83 opened this issue Dec 12, 2023 · 2 comments

Comments

@maxheld83
Copy link

I sometimes enter postings like so:

1970-01-01 * "coffee"
  Expenses:Food:Net           2.13 / 1.19 EUR
  Expenses:Food:Taxes  2.13 / 1.19 * 0.19 EUR ; for example to calculate tax
  Assets:Cash

For example, such a transaction may be necessary to impute a VAT share which wasn't explicitly listed on a receipt.

This will become:

1970-01-01 * "coffee"
  Expenses:Food:Net   1.789915966386555 EUR
  Expenses:Food:Taxes 0.340084033613445 EUR
  Assets:Cash

The trouble with this is, that I now have too many decimal places in my transaction,
which may then continue to mess up tolerance calculations.
And anyway: it's wrong -- the amounts were, in fact, rounded upon payment.

It would be nice if I could somehow express that I want the results of some arithmetic to be rounded, perhaps by either:

  1. leveraging the ~ syntax (i.e. 2.13 / 1.19 ~ 0.01 EUR)
  2. ignoring the significant digits resulting from numbers entered via arithmetic (analogous treatment to costs)
  3. allowing some more python syntax like round() (might open a can of worms)
@blais
Copy link
Member

blais commented Dec 13, 2023 via email

@blais
Copy link
Member

blais commented Dec 19, 2023

Added here: https://docs.google.com/document/d/1qPdNXaz5zuDQ8M9uoZFyyFis7hA0G55BEfhWhrVBsfc/edit#heading=h.ub6cn7jl1vq

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants