For a bit more context on the internals for this, here's where the original design for this had led me: https://github.com/beancount/beancount/blob/master/beancount/core/display_context.py#L71 - MOST_COMMON is used for currencies themselves - MAXIMUM is used when currency rendered as price for something else.
I should (a) extend this to arbitrary price pairs (b) allow users to override them and always use explicitly set values Another detail is that in v3 that'll get used in the SQL query tool, so I'll need to a way to transmit that precision information to it. On Sun, Nov 15, 2020 at 9:38 AM Martin Blais <[email protected]> wrote: > Use "bean-doctor display_context <filename>" to view the tolerances > inferred. > They're inferred from the other numbers in your file. > > This is an issue that's annoying me a lot; I'd gladly fix it, but it's > easily a couple of days of work to do this properly. It's needed because > some numbers are intended to be rounded (e.g. resulting from arithmetic > operations). Fixing it is not as straightforward as providing one default > per-currency, because the precision to be used for rendering depends on > whether the price is being used to render units in the currency itself or > used to render a price, and even then, the number of digits to be used > depends on what other commodity it's pricing. I need to change the design > so that a dictionary of precision per currency PAIRS is inferred and can be > overridden (not just the default) by the user, for each pair. Ideally > one should be able to just set the precision for > - currency > - currency when used as a price (default for all commodities) > - currency when used to price commodity X > > > > On Sun, Nov 15, 2020 at 4:38 AM Cameron Wood <[email protected]> > wrote: > >> Hello, and thank you for your reply. >> >> >> On Saturday, 14 November 2020 at 22:19:53 UTC+1 [email protected] wrote: >> >>> I don't have any immediate help, but was wondering if you could give an >>> example of where it's being represented as a decimal? What do the opening >>> / initialization lines look like for your new account? (vs the old one?) >> >> >> So I see this when looking at the holding or balance sheet in Fava, or >> when using bean-report to run the holdings and balances reports. >> >> The opening/initialisation lines are pretty much identical, which is what >> lead to my comment about thinking there is an error somewhere else in my >> ledger or if this could be bug even. Below are the openings in question... >> >> 1970-01-01 open Assets:ING-DiBa:Shares:DIS DIS >> 1970-01-01 open Assets:ING-DiBa:Shares:MSFT MSFT >> 1970-01-01 open Assets:ING-DiBa:Shares:NFLX NFLX >> 1970-01-01 open Assets:ING-DiBa:Shares:TEAM TEAM >> 1970-01-01 open Assets:ING-DiBa:Shares:ACME ACME >> >> so if I change the posting to be MSFT, NFLX, or TEAM, it renders as `100 >> XXXX` in the reports/views, but if I set it to ACME or DIS it displays as >> `100.00 XXXX` which has me at a bit of a loss currently. >> >> Thanks again, and if you happen to think of any ideas/suggestions, it'd >> be greatly appreciated. >> >> Kind regards, >> Cameron. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Beancount" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/beancount/5cb82a34-8c1b-46f0-8a38-18220087f9ffn%40googlegroups.com >> <https://groups.google.com/d/msgid/beancount/5cb82a34-8c1b-46f0-8a38-18220087f9ffn%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- You received this message because you are subscribed to the Google Groups "Beancount" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CAK21%2BhM4M7_RnbPwnEzE5epjRv3ebJk7cn2qB4Evs1FPXpDX3Q%40mail.gmail.com.
