Using the correct hledger commodity format

Hi

Recently had a discussion with another user about how commodities should be formatted in hledger.

According to this section of the hledger manual, I should write them out as:

commodity "1 000.00" EUR

However, it seems that this does not reflect the current behaviour (as noted by this user):

Example file:

commodity 1 000.00 EUR

2026-10-21 (c0) foo|test1
    assets:bankA   1337.00 EUR
    assets:bankB  -1337.00 EUR

2026-10-21 (c1) foo|test2
    assets:bankA     0.135 EUR
    assets:bankB    -0.135 EUR

2026-10-21 (c2) foo|test3
    assets:bankA    -0.135 EUR
    assets:bankB     0.135 EUR
  • With no commodity set --> hl bs shows 1337.000 EUR
  • With commodity 1 000.00 EUR (as in example file): 1 337.00 EUR
  • With commodity "1 000.00 EUR": 1337.000 EUR (reverting to default?)
  • With commodity "1 000.00" EUR: Error: test.journal:1:22: unexpected 'E'; expecting '+', '-', ';', end of input, newline, or number

Note: When changing tx c0 to assets:bankA 1 337.00 EUR (as usually in my ledgers), the bad outputs have 1 337.000 EUR (as in my previous comment).

So, what is the expected syntax?

  1. 1 000.00 EUR ; No quotes
  2. "1 000.00 EUR" ; Quotes around all
  3. "1 000.00" EUR ; Quotes around numbers only

The quotes are used only around commodity symbols with unusual characters. Never around the amount's quantity. Maybe the doc is confusing ?