From 86ffef105717d26fb33bf418e069105c2ef34c93 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Tue, 11 Feb 2020 10:23:52 -0800 Subject: [PATCH] ;doc:journal: edits, Amount display format -> Amount display style (#1187) Drop occasional use of "display format", prefer "display style". [ci skip] --- hledger-lib/Hledger/Data/Journal.hs | 10 +++++----- hledger-lib/hledger_journal.m4.md | 17 ++++++++--------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/hledger-lib/Hledger/Data/Journal.hs b/hledger-lib/Hledger/Data/Journal.hs index 28c235702..377baeb16 100644 --- a/hledger-lib/Hledger/Data/Journal.hs +++ b/hledger-lib/Hledger/Data/Journal.hs @@ -900,11 +900,11 @@ checkBalanceAssignmentUnassignableAccountB p = do -- --- | Choose and apply a consistent display format to the posting --- amounts in each commodity. Each commodity's format is specified by --- a commodity format directive, or otherwise inferred from posting --- amounts as in hledger < 0.28. Can return an error message --- eg if inconsistent number formats are found. +-- | Choose and apply a consistent display style to the posting +-- amounts in each commodity. Each commodity's style is specified by a +-- commodity (or D) directive, or otherwise inferred from posting +-- amounts. Can return an error message eg if inconsistent number +-- formats are found. journalApplyCommodityStyles :: Journal -> Either String Journal journalApplyCommodityStyles j@Journal{jtxns=ts, jpricedirectives=pds} = case journalInferCommodityStyles j of diff --git a/hledger-lib/hledger_journal.m4.md b/hledger-lib/hledger_journal.m4.md index 8681e3481..85b768a00 100644 --- a/hledger-lib/hledger_journal.m4.md +++ b/hledger-lib/hledger_journal.m4.md @@ -471,11 +471,11 @@ commodity INR 9,99,99,999.00 commodity 1 000 000.9455 ``` -### Amount display format +### Amount display style For each commodity, hledger chooses a consistent format to use when displaying amounts. (Except [price amounts](#prices), which are always -displayed as written). The display format is chosen as follows: +displayed as written). The display style is chosen as follows: - If there is a [commodity directive](#declaring-commodities) for the commodity, that format is used (see examples above). @@ -488,12 +488,11 @@ displayed as written). The display format is chosen as follows: - Or if there are no such amounts in the journal, a default format is used (like `$1000.00`). -Price amounts, and amounts in `D` directives don't affect the amount -display format directly, but occasionally they can do so indirectly. -(Eg when D's default commodity is applied to a commodity-less amount, -or when an amountless posting is balanced using a price's commodity, -or when -V is used.) If you find this causing problems, use a -commodity directive to set the display format. +Transaction price amounts don't affect the amount display style +directly, but occasionally they can do so indirectly (eg when an +posting's amount is inferred using a transaction price). If you find +this causing problems, use a commodity directive to fix the display +style. ## Transaction prices @@ -885,7 +884,7 @@ The `commodity` directive has several functions: data. (Without this, hledger will parse both `1,000` and `1.000` as 1). -3. It declares the [amount display format](#amount-display-format) to +3. It declares the [amount display style](#amount-display-style) to use in output - decimal and digit group marks, number of decimal places, symbol placement etc.