From 9112e077ba2035b7a364256abff2a2755ce2f424 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Tue, 11 Feb 2020 10:18:39 -0800 Subject: [PATCH] ;doc: journal: edits (#1187) [ci skip] --- hledger-lib/hledger_journal.m4.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hledger-lib/hledger_journal.m4.md b/hledger-lib/hledger_journal.m4.md index 0df74e867..8681e3481 100644 --- a/hledger-lib/hledger_journal.m4.md +++ b/hledger-lib/hledger_journal.m4.md @@ -880,7 +880,7 @@ The `commodity` directive has several functions: 1. It declares commodities which may be used in the journal. This is currently not enforced, but can serve as documentation. -2. It declares what decimal mark character to expect when parsing +2. It declares what decimal mark character (period or comma) to expect when parsing input - useful to disambiguate international number formats in your data. (Without this, hledger will parse both `1,000` and `1.000` as 1). @@ -929,9 +929,10 @@ The `D` directive sets a default commodity, to be used for amounts without a com This commodity will be applied to all subsequent commodity-less amounts, or until the next `D` directive. (Note, this is different from Ledger's `D`.) -`D` also sets that commodity's display format, as a `commodity` directive would (for compatibility/historical reasons). -If both directives are used, `commodity`'s format takes precedence. -As with `commodity`, the amount must always be written with a decimal mark. +For compatibility/historical reasons, `D` also acts like a [`commodity` directive](#declaring-commodities), +setting the commodity's [display style](#amount-display-format) (for output) and decimal mark (for parsing input). +As with `commodity`, the amount must always be written with a decimal mark (period or comma). +If both directives are used, `commodity`'s style takes precedence. The syntax is `D AMOUNT`. Eg: ```journal @@ -944,8 +945,6 @@ D $1,000.00 b ``` - - ### Market prices The `P` directive declares a market price, which is