handling multiple currencies

466 views
Skip to first unread message

Randy Josleyn

unread,
Jul 8, 2020, 10:45:45 AM7/8/20
to ledge...@googlegroups.com

Hi list,

I’ve rolled my own version of the full-fledged hledger noted in the hledger docs, where I’m mainly just using hledger to process the CSVs and ledger for the rest.

I live in China, but I’m American. I’m at the point where I’ve started adding my American accounts and that’s all fine and dandy. However, as my current tree of accounts gets more and more accounts with USD in them, it gets hard to read. Does anyone have any suggestions for how to manage this issue?

I was considering splitting assets and expenses by currency like below, but that could also make things a bit harder to read.

assets
  cash (usd/cny)
  CNY
    alipay
    icbc
  USD
    wells fargo...
expenses
  CNY
    entertainment
    food
    ...
  USD
    entertainment
    food
    ...

Does anyone have any experience with tracking multiple currencies? Perhaps there’s a simple query I could do that would limit transactions to only ones with a particular currency/commodity?

Thanks for your help!


Randy

o1bigtenor

unread,
Jul 8, 2020, 12:13:49 PM7/8/20
to Ledger
Dealing with multiple currencies is a challenge (period full stop!!). 

The official line is this (AIUI).
Your ledger is in the denomination of the country you pay taxes in. 

(If you pay personal taxes in multiple jurisdictions - - - will that's massively beyond my pay grade or experience!!!.) 
Practically that means that if you reside in the USA your recordkeeping 
files should be in USD. Transactions in any other currency are converted 
into USD. 

Multi-national companies somehow do things a little different 
than that - - - - but in a different country - - - - they pay taxes there - - - - 
the books for that division are in 'that' currency  (whatever that is). How that 
exactly gets rolled into the 'parent' company's book - - - - dunno. 
That level of taxation I don't know and don't really want to know about. 
AIUI it would mean complying with every country's taxation codes for that 
division's ledgers (and taxation) and my guess would be that the parent 
company uses sub-journals but please note - - - - - that is a GUESS! 
(Just want to keep that clear!!). 

Re-reading your message - - - - you are an American living and working abroad. 
This, IMO, is a somewhat special case. 
I would suggest you contact the IRS for guidance because they are going to 
have a mountain of demands for you and either you're going to get ahead of 
that falling mountain or it will crush you when it gets to you!

Regards

HTH

Martin Michlmayr

unread,
Jul 8, 2020, 9:09:12 PM7/8/20
to ledge...@googlegroups.com
* Randy Josleyn <randy....@gmail.com> [2020-07-08 22:45]:
> Does anyone have any experience with tracking multiple currencies?

I have 3 main currencies plus some more when I travel and I have no
problem.

> Perhaps there’s a simple query I could do that would limit
> transactions to only ones with a particular currency/commodity?

-l "commodity == 'USD'"

--
Martin Michlmayr
https://www.cyrius.com/

Andreas Pauley

unread,
Jul 9, 2020, 4:50:57 AM7/9/20
to Ledger


On Wednesday, 8 July 2020 16:45:45 UTC+2, Randy wrote:

I’ve rolled my own version of the full-fledged hledger noted in the hledger docs, where I’m mainly just using hledger to process the CSVs and ledger for the rest.


Sounds interesting, if you've written something about your setup please share a link.

 

I was considering splitting assets and expenses by currency like below, but that could also make things a bit harder to read.


I've found the Beancount account naming conventions useful, it suggests adding a country code to each account:
https://beancount.github.io/docs/18_command_line_accounting_cookbook.html#account-naming-conventions


And to limit transactions I just use the cur filter in hledger, e.g:
hledger bal cur:USD
 
Kind regards,
Andreas

Randy Josleyn

unread,
Jul 9, 2020, 10:19:49 AM7/9/20
to ledge...@googlegroups.com
I haven't even gotten to thinking about taxes, because taxes in China are pretty much non-interactive (no tax return or the like). I'm getting ready to move back to the US, though, and I want to be prepared with good bookkeeping habits by the time that actually happens. It's definitely also well beyond my own experience, as well!


Multi-national companies somehow do things a little different 
than that - - - - but in a different country - - - - they pay taxes there - - - - 
the books for that division are in 'that' currency  (whatever that is). How that 
exactly gets rolled into the 'parent' company's book - - - - dunno. 
That level of taxation I don't know and don't really want to know about. 
AIUI it would mean complying with every country's taxation codes for that 
division's ledgers (and taxation) and my guess would be that the parent 
company uses sub-journals but please note - - - - - that is a GUESS! 
(Just want to keep that clear!!). 

Re-reading your message - - - - you are an American living and working abroad. 
This, IMO, is a somewhat special case. 
I would suggest you contact the IRS for guidance because they are going to 
have a mountain of demands for you and either you're going to get ahead of 
that falling mountain or it will crush you when it gets to you!

Right now I've got my fingers crossed that repatriating myself and my assets will be relatively straightforward. (I'm pretty sure it won't work out so well, though.) Having good records will definitely help in that regard, though. Thanks for your suggestions.

Regards

HTH

--

---
You received this message because you are subscribed to the Google Groups "Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ledger-cli+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ledger-cli/CAPpdf58jqJqa5-4OLnrj4ecVnsufDcD0Di03K1VMA7d14e5Dyw%40mail.gmail.com.

Randy Josleyn

unread,
Jul 9, 2020, 10:22:06 AM7/9/20
to ledge...@googlegroups.com
On Thu, Jul 9, 2020 at 9:09 AM Martin Michlmayr <t...@cyrius.com> wrote:
* Randy Josleyn <randy....@gmail.com> [2020-07-08 22:45]:
> Does anyone have any experience with tracking multiple currencies?

I have 3 main currencies plus some more when I travel and I have no
problem.

Do you mind if I ask about how you've got your accounts structured?


> Perhaps there’s a simple query I could do that would limit
> transactions to only ones with a particular currency/commodity?

-l "commodity == 'USD'"

Thanks for this, I knew there had to be an option for it somewhere.


--
Martin Michlmayr
https://www.cyrius.com/

--

---
You received this message because you are subscribed to the Google Groups "Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ledger-cli+...@googlegroups.com.

Randy Josleyn

unread,
Jul 9, 2020, 10:31:43 AM7/9/20
to ledge...@googlegroups.com
On Thu, Jul 9, 2020 at 4:51 PM Andreas Pauley <adpg...@ml1.net> wrote:


On Wednesday, 8 July 2020 16:45:45 UTC+2, Randy wrote:

I’ve rolled my own version of the full-fledged hledger noted in the hledger docs, where I’m mainly just using hledger to process the CSVs and ledger for the rest.


Sounds interesting, if you've written something about your setup please share a link.

I do happen to have a blog, but I haven't updated it in awhile. If I do write something about this, I'll definitely let you know.
 

I was considering splitting assets and expenses by currency like below, but that could also make things a bit harder to read.


I've found the Beancount account naming conventions useful, it suggests adding a country code to each account:
https://beancount.github.io/docs/18_command_line_accounting_cookbook.html#account-naming-conventions


Thanks for the link, I'd never thought to look at the beancount documentation, this was helpful.


And to limit transactions I just use the cur filter in hledger, e.g:
hledger bal cur:USD
 
Thanks also for this. This happens to be a lot more concise than the -l option from ledger which Martin mentioned earlier in the thread. It's good to know different ways to achieve a goal.

 
Kind regards,
Andreas

--

---
You received this message because you are subscribed to the Google Groups "Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ledger-cli+...@googlegroups.com.

Martin Michlmayr

unread,
Jul 9, 2020, 10:45:48 AM7/9/20
to ledge...@googlegroups.com
* Randy Josleyn <randy....@gmail.com> [2020-07-09 22:31]:
> > And to limit transactions I just use the cur filter in hledger, e.g:
> > hledger bal cur:USD
>
> Thanks also for this. This happens to be a lot more concise than the -l
> option from ledger which Martin mentioned earlier in the thread. It's good
> to know different ways to achieve a goal.

The syntax above is for *h*ledger. The syntax I provided was for
ledger.

Randy Josleyn

unread,
Jul 9, 2020, 11:00:56 AM7/9/20
to ledge...@googlegroups.com
On Thu, Jul 9, 2020 at 10:45 PM Martin Michlmayr <t...@cyrius.com> wrote:

The syntax above is for *h*ledger.  The syntax I provided was for
ledger.

Yes, I understand. Sorry if what I wrote was unclear or sounded like judgment. I was just remarking that hledger's `cur:USD` is more concise than ledger's `-l "commodity == 'USD'"`. Not passing judgment or anything on either of the projects. I'm very grateful to the developers of both projects for creating such great software—and all they get in return for their hard work is people like me who don't know what they're doing asking silly questions in the mailing list. ;-)

--
Martin Michlmayr
https://www.cyrius.com/

--

---
You received this message because you are subscribed to the Google Groups "Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ledger-cli+...@googlegroups.com.

Martin Michlmayr

unread,
Jul 13, 2020, 1:28:39 AM7/13/20
to ledge...@googlegroups.com
* Randy Josleyn <randy....@gmail.com> [2020-07-09 22:21]:
> > I have 3 main currencies plus some more when I travel and I have no
> > problem.
>
> Do you mind if I ask about how you've got your accounts structured?

I do not add the currency to my account names. There are different
philosophies regarding account names and I lean towards simple account
names.

Many accounts only have one currency in them (e.g. a bank in one
country), but others have several currencies and I have not had any
problems with this. Something I limit the reg output to a specific
currency, but otherwise I don't think I use any "advanced" tricks.

What issues do you run into specifically?

Fergus Cameron

unread,
Jul 14, 2020, 2:01:03 PM7/14/20
to ledge...@googlegroups.com
Agree with Martin, do not try to organize accounts in relation to how
you understand them but how they are; idea being that ledger does the
processing to produce what you need; this is not to trivialize the
difficulties of course but generally, what you want to see at any
particular time changes more than things that tie into the external
view (i.e. tax and bank).

Ran small consulting business across Europe and the US using ledger (i.e.
6 currencies) and made the mistake you are thinking about (at least it
turned out to be a mistake for me). It resulted in complex reports to
accommodate a single, simplified view which tried to keep currencies
separate, but in the long-run I ended up with very awkward 3 or 4 stage
reports instead of slightly more complex 1 or 2 stage reports. And,
once I was that deep in, the initial desire for "can I just run
'ledger bal' and see this", was long gone.

All the best though, multiple currencies are not easy in my experience
and multiple jurisdictions are a nightmare.
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Ledger" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ledger-cli+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ledger-cli/20200713052832.GD8469%40jirafa.cyrius.com.
>

Randy Josleyn

unread,
Jul 16, 2020, 7:51:36 PM7/16/20
to ledge...@googlegroups.com, Martin Michlmayr
Sorry I didn't see your reply as it got lost in a sea of new email in my inbox. My reply is below.
My expense accounts are already fairly numerous, and if each had two or more currencies in them, I felt it would be harder to read the balance and register reports. I've seen some sites with advice about expense categories, but the expense accounts still feel "messy" to me. I should probably start by simplifying them.

Luckily my finances are version controlled, so I feel free to experiment.
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

Martin Michlmayr

unread,
Jul 16, 2020, 11:42:57 PM7/16/20
to Randy Josleyn, ledge...@googlegroups.com
* Randy Josleyn <randy....@gmail.com> [2020-07-17 07:51]:
> My expense accounts are already fairly numerous, and if each had two
> or more currencies in them, I felt it would be harder to read the
> balance and register reports. I've seen some sites with advice about
> expense categories, but the expense accounts still feel "messy" to
> me. I should probably start by simplifying them.

Right. For the balance report, several currencies in one account work
fairly well. For the register report, I agree that multiple
currencies are usually confusing and I often use -l "commodity == 'xxx'"
there.

BTW, I use ledger2beancount to convert my ledger file to beancount
and then use the web UI fava to look at transactions. I find that
to be a very powerful combination. Fava lets you define multiple
operating currencies and will show them in different columns (with one
column for all other currencies). So for example I have columns
EUR, GBP, USD, Other.

(As a command line type person, I can't stress how useful I find
the web UI fava.)

Randy Josleyn

unread,
Jul 24, 2020, 12:47:56 PM7/24/20
to ledge...@googlegroups.com, Fergus Cameron
Hi Fergus,

Thanks for sharing your experience with me. Yes, I can see how multiple jurisdictions would end up being a hassle, especially in your case! I'll take your advice and and let ledger do the heavy lifting if I need it. Luckily in my case I'm not trying to run a business or anything, so it's a lot more straightforward.

I'd be interested in reading about your experience using ledger for your business if you've put anything on the internet about it.

You received this message because you are subscribed to the Google Groups
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to ledger-cli+...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ledger-cli/20200713052832.GD8469%40jirafa.cyrius.com.


--
You received this message because you are subscribed to the Google Groups "Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ledger-cli+...@googlegroups.com.

Randy Josleyn

unread,
Jul 24, 2020, 12:59:13 PM7/24/20
to Martin Michlmayr, ledge...@googlegroups.com


On July 17, 2020 11:42:46 AM GMT+08:00, Martin Michlmayr <t...@cyrius.com> wrote:
>BTW, I use ledger2beancount to convert my ledger file to beancount
>and then use the web UI fava to look at transactions. I find that
>to be a very powerful combination. Fava lets you define multiple
>operating currencies and will show them in different columns (with one
>column for all other currencies). So for example I have columns
>EUR, GBP, USD, Other.
>
>(As a command line type person, I can't stress how useful I find
>the web UI fava.)

I'm traveling at the moment, but I'll definitely check this out when I get back to my computer. I do like myself a good web UI!
Reply all
Reply to author
Forward
0 new messages