;doc: journal: clarify commodity directive does not affect parsing
[ci skip]
This commit is contained in:
parent
34a0ad00b1
commit
bba9c32607
@ -793,7 +793,9 @@ Y2010 ; change default year to 2010
|
|||||||
|
|
||||||
### Declaring commodities
|
### Declaring commodities
|
||||||
|
|
||||||
The `commodity` directive declares commodities which may be used in the journal (though currently we do not enforce this).
|
The `commodity` directive declares commodities which may be used in the journal,
|
||||||
|
and their display format.
|
||||||
|
|
||||||
It may be written on a single line, like this:
|
It may be written on a single line, like this:
|
||||||
|
|
||||||
```journal
|
```journal
|
||||||
@ -819,12 +821,18 @@ commodity INR
|
|||||||
format INR 9,99,99,999.00
|
format INR 9,99,99,999.00
|
||||||
```
|
```
|
||||||
|
|
||||||
Commodity directives have a second purpose: they define the standard display format for amounts in the commodity.
|
Declaring commodites may be useful as documentation,
|
||||||
|
but currently we do not enforce that only declared commodities may be used.
|
||||||
|
This directive is mainly useful for customising the preferred display format for a commodity.
|
||||||
|
|
||||||
Normally the display format is inferred from journal entries, but this can be unpredictable;
|
Normally the display format is inferred from journal entries, but this can be unpredictable;
|
||||||
declaring it with a commodity directive overrides this and removes ambiguity.
|
declaring it with a commodity directive overrides this and removes ambiguity.
|
||||||
Towards this end, amounts in commodity directives must always be written with a decimal point
|
Towards this end, amounts in commodity directives must always be written with a decimal point
|
||||||
(a period or comma, followed by 0 or more decimal digits).
|
(a period or comma, followed by 0 or more decimal digits).
|
||||||
|
|
||||||
|
Commodity directives do not affect how amounts are parsed;
|
||||||
|
the parser will read multiple formats.
|
||||||
|
|
||||||
### Default commodity
|
### Default commodity
|
||||||
|
|
||||||
The `D` directive sets a default commodity (and display format), to be used for amounts without a commodity symbol (ie, plain numbers).
|
The `D` directive sets a default commodity (and display format), to be used for amounts without a commodity symbol (ie, plain numbers).
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user