mirror of
https://github.com/simonmichael/hledger.git
synced 2024-12-26 20:02:27 +03:00
;doc:journal: edits, Amount display format -> Amount display style (#1187)
Drop occasional use of "display format", prefer "display style". [ci skip]
This commit is contained in:
parent
9112e077ba
commit
86ffef1057
@ -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
|
||||
|
@ -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.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user