Mixing Apples and Oranges - why so many "commodities"

Thanks to everyone for their thoughtful insights for a PTA / hledger newbie.

I still want to adhere to the single currency principle in my journal entries and reporting. Nonadherence is a dealbreaker for me. For the moment, I'll keep seeing if I can make it work.

Final thought - friends don't let friends write bookkeeping software with floating point.

Might be not worth it. I have it on a good authority that there are 121 open and 357 closed hledger tickets if you search for "balance", and 164 open/390 closed tickets if you search for "account".

This is 1032 tickets related to account balances alone!

I appreciate this interesting discussion.

Also, hledger bug counts is a side topic, that probably deserves its own thread, but one I am especially interested in. So apologies for going off into the weeds:

As a general remark, hledger is cross platform software, developed for 17 years, that aims to be extremely flexible, and that deliberately sets out to handle freeform text rather than a much simpler data format. So it has a huge surface area, and of course there will be bugs (even though using haskell helps a lot). And with many people using it, we do see them reported in the issue tracker. And as a smallish FOSS project developed in "spare time", and since most hledger bugs do not affect most users, the rate at which they get fixed can be slow. The end result is that we see plenty of open bugs in the issue tracker.

It is indeed interesting to think about an alternate hledger that didn't support multiple currencies. Certainly that would have removed some code and some bugs and some work (and some users). But, I think the issue tracker would still contain plenty of open bugs. That's just normal, for usual economic/priority/technical reasons.

Anyway I had a look there myself just now, not to defend our issue counts but for my own insight. Note that we need to search for the A-BUG label, since many issues in the hledger issue tracker are "wishes", ie feature requests. As of just now, I find:

67 open bugs

including

4 open bugs mentioning "conversion", not about CSV

Of these,

  • #2092 seems to be agreed to be not a bug, though perhaps something we can document better. It's a niche case that few users will ever notice. It happens only when using the not-so-recommended --infer-market-prices flag, which is warned about in docs (in a general way). We could add a mention of this issue specifically.

  • #2056 points out that the add command isn't consistent with the rest of hledger in being able to detect redundant @ cost notation and equity postings. Definitely a bug we should fix, though few people will notice it.

  • #1959 may or may not be more than a documentation bug. Here someone got a surprise due to relying on inferred conversion costs, rather than recording them explicitly with cost notation or equity postings. We warn against this in the manual, and we could add this warning in more places.

  • #1852 is a preemptive report by me of an obscure bug that nobody notices, again involving --infer-market-prices.

I know "conversion" is just one search. I tried a search for the "valuation" label, which found one more open bug:

  • #818 a seven year old preemptive report by me of a corner case no-one cares about, involving the D directive which is documented in the not-recommended "Other syntax" section.

Running these searches for closed bugs instead, and throwing out a few unrelated, finds about 35 bugs closed in this area. Here are the counts by year:

2025: 1
2024: 7
2023: 9
2022: 1
2021: 4
2020: 5
2019: 3
2018: 0
2017: 2
2016: 1
2015: 2

From this I get the impression that yes multicurrency support certainly generates work and bugs, but we are keeping ahead of them and the current state is rather robust.

Thanks for the "bug" comments. I only brought up bugs because mixed unit computations are a notorious source of bugs. And it's only compounded when the unit conversions are time sensitive.

I want to make clear that I have not had any problems with bugs, but so far, all my numbers are US dollars. I can probably continue this way, with my stocks being tracked by my broker and my rare foreign currency transaction being instantly dollarized by my credit card company (no time for gains or losses).

It is quite possible to think of an alternate hledger that still supports multiple currencies but uses a single currency for all account postings. It is only necessary to post the right side of the "commodity @@ total price" to the account. The commodity can be a foreign currency (or any other fungible asset). Unfortunately, that ship sailed decades ago.

As far as the bugs, I thought I had seen some bugs associated with precision/rounding in unit conversion, but it's possible I'm recalling reports related to other PTA programs.

As an aside, I'm fascinated by functional programming, and learning Haskel is on my to-do list. Unfortunately, my head wants to explode when I see the word "monad". I do feel that much of the low bug count for hledger is related to the use of functional programming.

1 Like