Skip to content

Commit

Permalink
;doc:journal:transaction balancing, commodity directive: simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmichael committed Mar 1, 2024
1 parent babaf70 commit 67f027d
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions hledger/hledger.m4.md
Expand Up @@ -1527,7 +1527,7 @@ which are difficult or inconvenient to handle on a computer.
So to be a practical accounting system, hledger allows some imprecision when checking transaction balancedness.
The question is, how much imprecision should be allowed ?

hledger currently decides it based on the [commodity display styles](#commodity-display-style)(\*):
hledger currently decides it based on the [commodity display styles](#commodity-display-style):
if the postings' sum would appear to be zero when displayed with the standard display precisions, the transaction is considered balanced.

Or equivalently: if the journal entry is displayed with amounts rounded to the
Expand All @@ -1543,11 +1543,8 @@ you might need to fix some of your journal entries (ie, add decimal digits to ma
Other PTA tools (Ledger, Beancount..) have their own ways of doing it.
Possible improvements are discussed at [#1964](https://github.com/simonmichael/hledger/issues/1964).

(\*) (If you have multiple journal files, watch out for this snag:
`commodity` directives should be placed where they influence all files, eg in a topmost parent file.
Related:
[`commodity` directive](#commodity-directive),
[#2135](https://github.com/simonmichael/hledger/issues/2135))
Note: if you have multiple journal files, and are relying on commodity directives to make imprecise journal entries balance,
the directives' placement might be important - see [`commodity` directive](#commodity-directive).

## Tags

Expand Down Expand Up @@ -2117,9 +2114,8 @@ Declaring commodities solves several common parsing/display problems, so we reco
Note that effects 3 and 4 above end at the end of the directive's file,
and will not affect sibling or parent files.
So if you are relying on them (especially 4) and using multiple files,
consider placing your commodity directives in a top-level parent file,
where they can influence all the included files.
(Though I keep mine in a `YYYY-commodities` child file without trouble.)
placing your commodity directives in a top-level parent file might be important.
Or, keep your decimal marks unambiguous and your entries well balanced and precise.

(Related: [#793](https://github.com/simonmichael/hledger/issues/793))

Expand Down

0 comments on commit 67f027d

Please sign in to comment.