;doc: csv: amount decimal places: expand, note import behaviour
This commit is contained in:
parent
6fa69ab6e2
commit
69c0df4390
@ -3834,13 +3834,19 @@ that would trigger the prepending effect, which we don't want here.
|
|||||||
|
|
||||||
### Amount decimal places
|
### Amount decimal places
|
||||||
|
|
||||||
Like amounts in a journal file,
|
When you are reading CSV data, eg with a command like `hledger -f foo.csv print`,
|
||||||
the amounts generated by CSV rules like `amount1` influence
|
hledger will infer each commodity's decimal precision (and other [commodity display styles](#commodity-display-styles))
|
||||||
[commodity display styles](#commodity-display-styles), such as
|
from the amounts - much as when reading a journal file without `commodity` directives (see the link).
|
||||||
the number of decimal places displayed in reports.
|
But note these commodity styles are not inferred from the numbers in the original CSV data;
|
||||||
|
rather, they are inferred from the journal entries generated by the CSV rules.
|
||||||
|
|
||||||
The original amounts as written in the CSV file do not affect display
|
When you are importing CSV data with the `import` command, eg `hledger import foo.csv`,
|
||||||
style (because we don't yet reliably know their commodity).
|
it's a little different: `import` [applies](#commodity-display-styles) the journal's existing commodity styles to the new entries.
|
||||||
|
So for each commodity, let's say for EUR, `import` will use:
|
||||||
|
|
||||||
|
1. the style declared for EUR by a [`commodity` directive](#commodity-directive) in the journal
|
||||||
|
2. or if there's no such directive: the style inferred from EUR amounts in the journal
|
||||||
|
3. or if there are no EUR amounts in the journal: the style inferred from EUR amounts generated by the CSV rules.
|
||||||
|
|
||||||
### Referencing other fields
|
### Referencing other fields
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user