-
-
Notifications
You must be signed in to change notification settings - Fork 292
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
Comments
Why don't you make yourself a plugin that does this for you?
I think one thing that might be interesting would be to define a division
operator that quantizes to the declared precision automatically, like /. Or
something like that
…On Tue, Dec 12, 2023, 10:38 Max Held ***@***.***> wrote:
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)
—
Reply to this email directly, view it on GitHub
<#795>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACSBE7C2OFZZAFAJQO47KLYJCB7XAVCNFSM6AAAAABARYT33GVHI2DSMVQWIX3LMV43ASLTON2WKOZSGAZTQMJWGA4DENI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I sometimes enter postings like so:
For example, such a transaction may be necessary to impute a VAT share which wasn't explicitly listed on a receipt.
This will become:
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:
~
syntax (i.e. 2.13 / 1.19 ~ 0.01 EUR)round()
(might open a can of worms)The text was updated successfully, but these errors were encountered: