r/plaintextaccounting • • 12d ago

Ledger-cli currency conversion not working

I am trying to understand how to set currency conversion rates in my ledger file but I cannot figure out how it's supposed to work. I have the following example for testing:

P 2026/11/19 A$ $3

2026/11/19 don don
  Expenses:Food  A$15
  Assets:Checking

P 2026/11/20 A$ $2

2026/11/20 laundry
  Expenses:Utilities  A$15
  Assets:Checking

2026/11/20 aldi
  Expenses:Groceries  A$15
  Assets:Checking

When I run ledger -f finances.ledger -X $ bal it only uses the 11/20 conversion rate, printing

                $-90  Assets:Checking
                 $90  Expenses
                 $30    Food
                 $30    Groceries
                 $30    Utilities
--------------------
                   0

How do I get the conversion rates for each day to be taken into account rather than just defaulting to the latest for every historical entry?

4 Upvotes

6 comments sorted by

2

u/simonmic hledger creator 12d ago edited 11d ago

ledger reg -X $ uses the daily rates. I don't know if ledger bal can do that. (In hledger it's bal --value=then)

1

u/Nurahk 12d ago

Thank you for your response. So is the expected behavior for bal to just default to the latest exchange rate and apply that to every transaction when converting? In that case, is reg the only reason to keep regular records of exchange rates in your ledger file?

It seems strange to me for reg to take all the rates into account but bal not to.

3

u/simonmic hledger creator 11d ago edited 11d ago

Yes - either report could use either set of dates, but I would say that's the expected default behaviour. The register report shows events over a period of time, valued on each event date; the balance report shows a snapshot of balances (or balance changes) at a single point in time, valued on that end date.

I found how to do it with Ledger: ledger bal -X $ -H

2

u/Nurahk 11d ago

that worked, thank you so much!

0

u/thomasvdb13 12d ago

!remindme next week

0

u/RemindMeBot 12d ago

I will be messaging you in 7 days on 2026-11-27 11:55:22 UTC to remind you of this link

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.

RemindMeBot is switching to username summons. Instead of !RemindMe 1 day, use u/RemindMeBot 1 day. More info.


InfoCustomYour RemindersFeedback