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

Use hard-coded precision of 12 instead of 4 #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vorburger
Copy link
Contributor

@xuhcc how about this?

Or do you have to know how to do this better, and actually use the precision set on a commodity in Beancount? (I do not know how to do that.)

@xuhcc
Copy link
Owner

xuhcc commented Dec 26, 2024

I prefer 4 but it can be made configurable via envvar

@vorburger
Copy link
Contributor Author

I prefer 4 but it can be made configurable via envvar

That actually just feels so "redundant"... when I have a bit more time than I do right now, then I'll try to see if we couldn't just import prices "with the precision used in the JSON"... So, looking e.g. at https://api.frankfurter.dev/v1/latest, it should "automagically" be precision 4 for most of those prices which use 4, but be 1, or 2 or 3 (or 5, for GBP) for some of the others. For BTC from Fixer.io & exchangeratesapi.io it would then "automagically" be 6. Would that make sense to you @xuhcc ?

PS: Alternatively, perhaps it's worth for someonw to poke around more how beanprice itself does it...

@xuhcc
Copy link
Owner

xuhcc commented Dec 27, 2024

If I remember correctly, precision of prices affects precision of amounts in various reports. Perhaps numbers provided by API at the time had too much decimal places, so I decided to truncate them.

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

Successfully merging this pull request may close these issues.

2 participants