;csv: amount-setting doc tweaks
This commit is contained in:
parent
b81f8f768d
commit
b114571d26
@ -4059,7 +4059,7 @@ Here are the ways to set a posting's amount:
|
|||||||
|
|
||||||
c. **If both fields, or neither field, can contain a non-zero value:**\
|
c. **If both fields, or neither field, can contain a non-zero value:**\
|
||||||
hledger normally expects exactly one of the fields to have a non-zero value.
|
hledger normally expects exactly one of the fields to have a non-zero value.
|
||||||
Eg, the `amountN-in`/`amountN-out` rules would reject values like these:
|
Eg, the `amountN-in`/`amountN-out` rules would reject value pairs like these:
|
||||||
|
|
||||||
```csv
|
```csv
|
||||||
"", ""
|
"", ""
|
||||||
@ -4067,7 +4067,7 @@ Here are the ways to set a posting's amount:
|
|||||||
"1", "none"
|
"1", "none"
|
||||||
```
|
```
|
||||||
|
|
||||||
So, use [conditional rules](#if-block) to set the amount from the appropriate field.
|
So, use smarter [conditional rules](#if-block) to set the amount from the appropriate field.
|
||||||
Eg, these rules would make it use only the value containing non-zero digits,
|
Eg, these rules would make it use only the value containing non-zero digits,
|
||||||
handling the above:
|
handling the above:
|
||||||
|
|
||||||
@ -4080,8 +4080,8 @@ Here are the ways to set a posting's amount:
|
|||||||
```
|
```
|
||||||
|
|
||||||
3. **If you are stuck with hledger <1.17, or you want posting 2's amount converted to cost:**\
|
3. **If you are stuck with hledger <1.17, or you want posting 2's amount converted to cost:**\
|
||||||
Use the old numberless syntax, which sets amount1 and amount2:
|
Assign to `amount` (or to `amount-in` and `amount-out`).
|
||||||
assign to `amount` (or to `amount-in` and `amount-out`).
|
(The old numberless syntax, which sets amount1 and amount2.)
|
||||||
|
|
||||||
4. **If the CSV has the balance instead of the transaction amount:**\
|
4. **If the CSV has the balance instead of the transaction amount:**\
|
||||||
Assign to `balanceN`, which sets posting N's amount indirectly via a
|
Assign to `balanceN`, which sets posting N's amount indirectly via a
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user