;journal: doc: commodity display style examples

This commit is contained in:
Simon Michael 2020-12-22 15:38:13 -08:00
parent 630347e0e8
commit 2d6ccd616e

View File

@ -481,8 +481,8 @@ commodity 1 000 000.9455
## Commodity display style ## Commodity display style
For each commodity, hledger chooses a consistent style to use when For the amounts in each commodity, hledger chooses a consistent display style.
displaying amounts. (Except [price amounts](#prices), which are always (Excluding [price amounts](#prices), which are always
displayed as written). The display style is chosen as follows: displayed as written). The display style is chosen as follows:
- If there is a [commodity directive](#declaring-commodities) (or - If there is a [commodity directive](#declaring-commodities) (or
@ -512,8 +512,16 @@ In summary, each commodity's amounts will be normalised to
- or, the style of the first posting amount in the journal, - or, the style of the first posting amount in the journal,
with the first-seen digit group style and the maximum-seen number of decimal places. with the first-seen digit group style and the maximum-seen number of decimal places.
If reports are showing amounts in a way you don't like (eg, with too many decimal places), So if your reports are showing amounts in a way you don't like, eg
use a [commodity directive](#declaring-commodities) to set your preferred style. with too many decimal places,
use a [commodity directive](#declaring-commodities) to set the commodity's display style.
For example:
```journal
# declare euro, dollar and bitcoin commodities and set their display styles:
commodity EUR 1.000,
commodity $1000.00
commodity 1000.00000000 BTC
```
## Rounding ## Rounding