doc: move cost/market value into general options section

[ci skip]
This commit is contained in:
Simon Michael 2017-03-31 19:17:56 -07:00
parent 2f5c9df0de
commit d9488ea01b
9 changed files with 581 additions and 558 deletions

View File

@ -540,8 +540,8 @@ Market prices are not tied to a particular transaction; they represent
historical exchange rates between two commodities.
(Ledger calls them historical prices.) For example, the prices published
by a stock exchange or the foreign exchange market.
Some commands (balance, currently) can use this information to show the
market value of things at a given date.
hledger can use these prices to show the market value of things at a
given date, see market value.
.PP
To record market prices, use P directives in the main journal or in an
included file.

View File

@ -540,9 +540,8 @@ File: hledger_journal.5.info, Node: Market prices, Prev: Transaction prices,
Market prices are not tied to a particular transaction; they represent
historical exchange rates between two commodities. (Ledger calls them
historical prices.) For example, the prices published by a stock
exchange or the foreign exchange market. Some commands (balance,
currently) can use this information to show the market value of things
at a given date.
exchange or the foreign exchange market. hledger can use these prices
to show the market value of things at a given date, see market value.
To record market prices, use P directives in the main journal or in
an included file. Their format is:
@ -1005,39 +1004,39 @@ Node: Transaction prices18256
Ref: #transaction-prices18401
Node: Market prices19978
Ref: #market-prices20113
Node: Comments21086
Ref: #comments21208
Node: Tags22321
Ref: #tags22441
Node: Implicit tags23870
Ref: #implicit-tags23978
Node: Directives24495
Ref: #directives24610
Node: Account aliases24803
Ref: #account-aliases24949
Node: Basic aliases25553
Ref: #basic-aliases25698
Node: Regex aliases26388
Ref: #regex-aliases26558
Node: Multiple aliases27329
Ref: #multiple-aliases27503
Node: end aliases28001
Ref: #end-aliases28143
Node: account directive28244
Ref: #account-directive28426
Node: apply account directive28722
Ref: #apply-account-directive28920
Node: Multi-line comments29579
Ref: #multi-line-comments29771
Node: commodity directive29899
Ref: #commodity-directive30085
Node: Default commodity30957
Ref: #default-commodity31132
Node: Default year31669
Ref: #default-year31836
Node: Including other files32259
Ref: #including-other-files32418
Node: EDITOR SUPPORT32815
Ref: #editor-support32935
Node: Comments21073
Ref: #comments21195
Node: Tags22308
Ref: #tags22428
Node: Implicit tags23857
Ref: #implicit-tags23965
Node: Directives24482
Ref: #directives24597
Node: Account aliases24790
Ref: #account-aliases24936
Node: Basic aliases25540
Ref: #basic-aliases25685
Node: Regex aliases26375
Ref: #regex-aliases26545
Node: Multiple aliases27316
Ref: #multiple-aliases27490
Node: end aliases27988
Ref: #end-aliases28130
Node: account directive28231
Ref: #account-directive28413
Node: apply account directive28709
Ref: #apply-account-directive28907
Node: Multi-line comments29566
Ref: #multi-line-comments29758
Node: commodity directive29886
Ref: #commodity-directive30072
Node: Default commodity30944
Ref: #default-commodity31119
Node: Default year31656
Ref: #default-year31823
Node: Including other files32246
Ref: #including-other-files32405
Node: EDITOR SUPPORT32802
Ref: #editor-support32922

End Tag Table

View File

@ -442,7 +442,7 @@ Market prices are not tied to a particular transaction; they represent historica
(Ledger calls them historical prices.)
For example, the prices published by a [stock exchange](https://en.wikipedia.org/wiki/Stock_exchange)
or the [foreign exchange market](https://en.wikipedia.org/wiki/Foreign_exchange_market).
Some commands ([balance](hledger.html#market-value), currently) can use this information to show the market value of things at a given date.
hledger can use these prices to show the market value of things at a given date, see [market value](#market-value).
To record market prices, use P directives in the main journal or
in an [included](#including-other-files) file. Their format is:

View File

@ -411,9 +411,8 @@ FILE FORMAT
Market prices are not tied to a particular transaction; they represent
historical exchange rates between two commodities. (Ledger calls them
historical prices.) For example, the prices published by a stock
exchange or the foreign exchange market. Some commands (balance, cur-
rently) can use this information to show the market value of things at
a given date.
exchange or the foreign exchange market. hledger can use these prices
to show the market value of things at a given date, see market value.
To record market prices, use P directives in the main journal or in an
included file. Their format is:

View File

@ -233,53 +233,6 @@ Balance changes in 2008:
```
### Market value
The `-V/--value` flag converts the reported amounts to their market value
on the report end date, using the most recent applicable market prices,
when known.
Specifically, when there is a [market price](journal.html#market-prices) (P directive)
for the amount's commodity, dated on or before the
[report end date](hledger.html#report-start-end-date) (see hledger -> Report start & end date),
the amount will be converted to the price's commodity.
If multiple applicable prices are defined, the latest-dated one is used
(and if dates are equal, the one last parsed).
For example:
```journal
# one euro is worth this many dollars from nov 1
P 2016/11/01 € $1.10
# purchase some euros on nov 3
2016/11/3
assets:euros €100
assets:checking
# the euro is worth fewer dollars by dec 21
P 2016/12/21 € $1.03
```
How many euros do I have ?
```
$ hledger -f t.j bal euros
€100 assets:euros
```
What are they worth on nov 3 ? (no report end date specified, defaults to the last date in the journal)
```
$ hledger -f t.j bal euros -V
$110.00 assets:euros
```
What are they worth on dec 21 ?
```
$ hledger -f t.j bal euros -V -e 2016/12/21
$103.00 assets:euros
```
Currently, hledger's -V only uses market prices recorded with P directives,
not [transaction prices](journal.html#transaction-prices) (unlike Ledger).
Using -B and -V together is allowed.
### Custom balance output
In simple (non-multi-column) balance reports, you can customise the

View File

@ -840,6 +840,71 @@ $\ hledger\ balance\ \-\-pivot\ member\ acct:.
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \-2\ EUR
\f[]
.fi
.SS Cost
.PP
The \f[C]\-B/\-\-cost\f[] flag converts amounts to their cost at
transaction time, if they have a transaction price specified.
.SS Market value
.PP
The \f[C]\-V/\-\-value\f[] flag converts the reported amounts to their
market value on the report end date, using the most recent applicable
market prices, when known.
Specifically, when there is a market price (P directive) for the
amount\[aq]s commodity, dated on or before the report end date (see
hledger \-> Report start & end date), the amount will be converted to
the price\[aq]s commodity.
If multiple applicable prices are defined, the latest\-dated one is used
(and if dates are equal, the one last parsed).
.PP
For example:
.IP
.nf
\f[C]
#\ one\ euro\ is\ worth\ this\ many\ dollars\ from\ nov\ 1
P\ 2016/11/01\ \ $1.10
#\ purchase\ some\ euros\ on\ nov\ 3
2016/11/3
\ \ \ \ assets:euros\ \ \ \ \ \ \ \ €100
\ \ \ \ assets:checking
#\ the\ euro\ is\ worth\ fewer\ dollars\ by\ dec\ 21
P\ 2016/12/21\ \ $1.03
\f[]
.fi
.PP
How many euros do I have ?
.IP
.nf
\f[C]
$\ hledger\ \-f\ t.j\ bal\ euros
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ €100\ \ assets:euros
\f[]
.fi
.PP
What are they worth on nov 3 ?
(no report end date specified, defaults to the last date in the journal)
.IP
.nf
\f[C]
$\ hledger\ \-f\ t.j\ bal\ euros\ \-V
\ \ \ \ \ \ \ \ \ \ \ \ \ $110.00\ \ assets:euros
\f[]
.fi
.PP
What are they worth on dec 21 ?
.IP
.nf
\f[C]
$\ hledger\ \-f\ t.j\ bal\ euros\ \-V\ \-e\ 2016/12/21
\ \ \ \ \ \ \ \ \ \ \ \ \ $103.00\ \ assets:euros
\f[]
.fi
.PP
Currently, hledger\[aq]s \-V only uses market prices recorded with P
directives, not transaction prices (unlike Ledger).
.PP
Using \-B and \-V together is allowed.
.SS Regular expressions
.PP
hledger uses regular expressions in a number of places:
@ -1494,67 +1559,6 @@ Balance\ changes\ in\ 2008:
#\ Average\ is\ rounded\ to\ the\ dollar\ here\ since\ all\ journal\ amounts\ are
\f[]
.fi
.SS Market value
.PP
The \f[C]\-V/\-\-value\f[] flag converts the reported amounts to their
market value on the report end date, using the most recent applicable
market prices, when known.
Specifically, when there is a market price (P directive) for the
amount\[aq]s commodity, dated on or before the report end date (see
hledger \-> Report start & end date), the amount will be converted to
the price\[aq]s commodity.
If multiple applicable prices are defined, the latest\-dated one is used
(and if dates are equal, the one last parsed).
.PP
For example:
.IP
.nf
\f[C]
#\ one\ euro\ is\ worth\ this\ many\ dollars\ from\ nov\ 1
P\ 2016/11/01\ \ $1.10
#\ purchase\ some\ euros\ on\ nov\ 3
2016/11/3
\ \ \ \ assets:euros\ \ \ \ \ \ \ \ €100
\ \ \ \ assets:checking
#\ the\ euro\ is\ worth\ fewer\ dollars\ by\ dec\ 21
P\ 2016/12/21\ \ $1.03
\f[]
.fi
.PP
How many euros do I have ?
.IP
.nf
\f[C]
$\ hledger\ \-f\ t.j\ bal\ euros
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ €100\ \ assets:euros
\f[]
.fi
.PP
What are they worth on nov 3 ?
(no report end date specified, defaults to the last date in the journal)
.IP
.nf
\f[C]
$\ hledger\ \-f\ t.j\ bal\ euros\ \-V
\ \ \ \ \ \ \ \ \ \ \ \ \ $110.00\ \ assets:euros
\f[]
.fi
.PP
What are they worth on dec 21 ?
.IP
.nf
\f[C]
$\ hledger\ \-f\ t.j\ bal\ euros\ \-V\ \-e\ 2016/12/21
\ \ \ \ \ \ \ \ \ \ \ \ \ $103.00\ \ assets:euros
\f[]
.fi
.PP
Currently, hledger\[aq]s \-V only uses market prices recorded with P
directives, not transaction prices (unlike Ledger).
.PP
Using \-B and \-V together is allowed.
.SS Custom balance output
.PP
In simple (non\-multi\-column) balance reports, you can customise the

View File

@ -126,6 +126,8 @@ File: hledger.1.info, Node: OPTIONS, Next: QUERIES, Prev: EXAMPLES, Up: Top
* Period expressions::
* Depth limiting::
* Pivoting::
* Cost::
* Market value::
* Regular expressions::

@ -508,7 +510,7 @@ will show only the uppermost accounts in the account tree, down to level
N. Use this when you want a summary with less detail.

File: hledger.1.info, Node: Pivoting, Next: Regular expressions, Prev: Depth limiting, Up: OPTIONS
File: hledger.1.info, Node: Pivoting, Next: Cost, Prev: Depth limiting, Up: OPTIONS
2.11 Pivoting
=============
@ -568,9 +570,67 @@ $ hledger balance --pivot member acct:.
-2 EUR

File: hledger.1.info, Node: Regular expressions, Prev: Pivoting, Up: OPTIONS
File: hledger.1.info, Node: Cost, Next: Market value, Prev: Pivoting, Up: OPTIONS
2.12 Regular expressions
2.12 Cost
=========
The '-B/--cost' flag converts amounts to their cost at transaction time,
if they have a transaction price specified.

File: hledger.1.info, Node: Market value, Next: Regular expressions, Prev: Cost, Up: OPTIONS
2.13 Market value
=================
The '-V/--value' flag converts the reported amounts to their market
value on the report end date, using the most recent applicable market
prices, when known. Specifically, when there is a market price (P
directive) for the amount's commodity, dated on or before the report end
date (see hledger -> Report start & end date), the amount will be
converted to the price's commodity. If multiple applicable prices are
defined, the latest-dated one is used (and if dates are equal, the one
last parsed).
For example:
# one euro is worth this many dollars from nov 1
P 2016/11/01 € $1.10
# purchase some euros on nov 3
2016/11/3
assets:euros €100
assets:checking
# the euro is worth fewer dollars by dec 21
P 2016/12/21 € $1.03
How many euros do I have ?
$ hledger -f t.j bal euros
€100 assets:euros
What are they worth on nov 3 ? (no report end date specified,
defaults to the last date in the journal)
$ hledger -f t.j bal euros -V
$110.00 assets:euros
What are they worth on dec 21 ?
$ hledger -f t.j bal euros -V -e 2016/12/21
$103.00 assets:euros
Currently, hledger's -V only uses market prices recorded with P
directives, not transaction prices (unlike Ledger).
Using -B and -V together is allowed.

File: hledger.1.info, Node: Regular expressions, Prev: Market value, Up: OPTIONS
2.14 Regular expressions
========================
hledger uses regular expressions in a number of places:
@ -999,7 +1059,6 @@ $ hledger balance -p 2008/6 expenses --no-total
* Flat mode::
* Depth limited balance reports::
* Multicolumn balance reports::
* Market value::
* Custom balance output::
* Output destination::
* CSV output::
@ -1038,7 +1097,7 @@ $ hledger balance -N --depth 1
$1 liabilities

File: hledger.1.info, Node: Multicolumn balance reports, Next: Market value, Prev: Depth limited balance reports, Up: balance
File: hledger.1.info, Node: Multicolumn balance reports, Next: Custom balance output, Prev: Depth limited balance reports, Up: balance
4.4.3 Multicolumn balance reports
---------------------------------
@ -1138,58 +1197,9 @@ Balance changes in 2008:
# Average is rounded to the dollar here since all journal amounts are

File: hledger.1.info, Node: Market value, Next: Custom balance output, Prev: Multicolumn balance reports, Up: balance
File: hledger.1.info, Node: Custom balance output, Next: Output destination, Prev: Multicolumn balance reports, Up: balance
4.4.4 Market value
------------------
The '-V/--value' flag converts the reported amounts to their market
value on the report end date, using the most recent applicable market
prices, when known. Specifically, when there is a market price (P
directive) for the amount's commodity, dated on or before the report end
date (see hledger -> Report start & end date), the amount will be
converted to the price's commodity. If multiple applicable prices are
defined, the latest-dated one is used (and if dates are equal, the one
last parsed).
For example:
# one euro is worth this many dollars from nov 1
P 2016/11/01 € $1.10
# purchase some euros on nov 3
2016/11/3
assets:euros €100
assets:checking
# the euro is worth fewer dollars by dec 21
P 2016/12/21 € $1.03
How many euros do I have ?
$ hledger -f t.j bal euros
€100 assets:euros
What are they worth on nov 3 ? (no report end date specified,
defaults to the last date in the journal)
$ hledger -f t.j bal euros -V
$110.00 assets:euros
What are they worth on dec 21 ?
$ hledger -f t.j bal euros -V -e 2016/12/21
$103.00 assets:euros
Currently, hledger's -V only uses market prices recorded with P
directives, not transaction prices (unlike Ledger).
Using -B and -V together is allowed.

File: hledger.1.info, Node: Custom balance output, Next: Output destination, Prev: Market value, Up: balance
4.4.5 Custom balance output
4.4.4 Custom balance output
---------------------------
In simple (non-multi-column) balance reports, you can customise the
@ -1249,7 +1259,7 @@ may be needed to get pleasing results.

File: hledger.1.info, Node: Output destination, Next: CSV output, Prev: Custom balance output, Up: balance
4.4.6 Output destination
4.4.5 Output destination
------------------------
The balance, print, register and stats commands can write their output
@ -1262,7 +1272,7 @@ $ hledger balance -o FILE # write to FILE

File: hledger.1.info, Node: CSV output, Prev: Output destination, Up: balance
4.4.7 CSV output
4.4.6 CSV output
----------------
The balance, print and register commands can write their output as CSV.
@ -2094,121 +2104,123 @@ Node: EXAMPLES1886
Ref: #examples1988
Node: OPTIONS3634
Ref: #options3738
Node: General options3993
Ref: #general-options4120
Node: Command options6643
Ref: #command-options6796
Node: Command arguments7194
Ref: #command-arguments7354
Node: Special characters7475
Ref: #special-characters7633
Node: Input files8801
Ref: #input-files8939
Node: Smart dates10902
Ref: #smart-dates11045
Node: Report start & end date12024
Ref: #report-start-end-date12196
Node: Report intervals13262
Ref: #report-intervals13427
Node: Period expressions13828
Ref: #period-expressions13988
Node: Depth limiting16328
Ref: #depth-limiting16474
Node: Pivoting16675
Ref: #pivoting16810
Node: Regular expressions18581
Ref: #regular-expressions18715
Node: QUERIES20076
Ref: #queries20180
Node: COMMANDS23826
Ref: #commands23940
Node: accounts24613
Ref: #accounts24713
Node: activity25695
Ref: #activity25807
Node: add26166
Ref: #add26267
Node: balance28925
Ref: #balance29038
Node: Flat mode31980
Ref: #flat-mode32107
Node: Depth limited balance reports32527
Ref: #depth-limited-balance-reports32730
Node: Multicolumn balance reports33150
Ref: #multicolumn-balance-reports33352
Node: Market value38000
Ref: #market-value38164
Node: Custom balance output39464
Ref: #custom-balance-output39637
Node: Output destination41730
Ref: #output-destination41895
Node: CSV output42165
Ref: #csv-output42284
Node: balancesheet42681
Ref: #balancesheet42809
Node: cashflow44716
Ref: #cashflow44833
Node: help46701
Ref: #help46813
Node: incomestatement47651
Ref: #incomestatement47781
Node: info49673
Ref: #info49780
Node: man50144
Ref: #man50241
Node: print50646
Ref: #print50751
Node: register54507
Ref: #register54620
Node: Custom register output59116
Ref: #custom-register-output59247
Node: stats60544
Ref: #stats60650
Node: test61531
Ref: #test61618
Node: ADD-ON COMMANDS61986
Ref: #add-on-commands62098
Node: Official add-ons63385
Ref: #official-add-ons63527
Node: api63614
Ref: #api63705
Node: ui63757
Ref: #ui63858
Node: web63916
Ref: #web64007
Node: Third party add-ons64053
Ref: #third-party-add-ons64230
Node: diff64365
Ref: #diff64464
Node: iadd64563
Ref: #iadd64679
Node: interest64762
Ref: #interest64885
Node: irr64980
Ref: #irr65080
Node: Experimental add-ons65158
Ref: #experimental-add-ons65312
Node: autosync65705
Ref: #autosync65819
Node: budget66058
Ref: #budget66182
Node: chart66248
Ref: #chart66367
Node: check66438
Ref: #check66562
Node: check-dates66629
Ref: #check-dates66771
Node: check-dupes66844
Ref: #check-dupes66987
Node: equity67064
Ref: #equity67192
Node: prices67311
Ref: #prices67440
Node: print-unique67495
Ref: #print-unique67644
Node: register-match67737
Ref: #register-match67893
Node: rewrite67991
Ref: #rewrite68112
Node: General options4019
Ref: #general-options4146
Node: Command options6669
Ref: #command-options6822
Node: Command arguments7220
Ref: #command-arguments7380
Node: Special characters7501
Ref: #special-characters7659
Node: Input files8827
Ref: #input-files8965
Node: Smart dates10928
Ref: #smart-dates11071
Node: Report start & end date12050
Ref: #report-start-end-date12222
Node: Report intervals13288
Ref: #report-intervals13453
Node: Period expressions13854
Ref: #period-expressions14014
Node: Depth limiting16354
Ref: #depth-limiting16500
Node: Pivoting16701
Ref: #pivoting16821
Node: Cost18592
Ref: #cost18702
Node: Market value18820
Ref: #market-value18957
Node: Regular expressions20257
Ref: #regular-expressions20395
Node: QUERIES21756
Ref: #queries21860
Node: COMMANDS25506
Ref: #commands25620
Node: accounts26293
Ref: #accounts26393
Node: activity27375
Ref: #activity27487
Node: add27846
Ref: #add27947
Node: balance30605
Ref: #balance30718
Node: Flat mode33643
Ref: #flat-mode33770
Node: Depth limited balance reports34190
Ref: #depth-limited-balance-reports34393
Node: Multicolumn balance reports34813
Ref: #multicolumn-balance-reports35024
Node: Custom balance output39672
Ref: #custom-balance-output39860
Node: Output destination41953
Ref: #output-destination42118
Node: CSV output42388
Ref: #csv-output42507
Node: balancesheet42904
Ref: #balancesheet43032
Node: cashflow44939
Ref: #cashflow45056
Node: help46924
Ref: #help47036
Node: incomestatement47874
Ref: #incomestatement48004
Node: info49896
Ref: #info50003
Node: man50367
Ref: #man50464
Node: print50869
Ref: #print50974
Node: register54730
Ref: #register54843
Node: Custom register output59339
Ref: #custom-register-output59470
Node: stats60767
Ref: #stats60873
Node: test61754
Ref: #test61841
Node: ADD-ON COMMANDS62209
Ref: #add-on-commands62321
Node: Official add-ons63608
Ref: #official-add-ons63750
Node: api63837
Ref: #api63928
Node: ui63980
Ref: #ui64081
Node: web64139
Ref: #web64230
Node: Third party add-ons64276
Ref: #third-party-add-ons64453
Node: diff64588
Ref: #diff64687
Node: iadd64786
Ref: #iadd64902
Node: interest64985
Ref: #interest65108
Node: irr65203
Ref: #irr65303
Node: Experimental add-ons65381
Ref: #experimental-add-ons65535
Node: autosync65928
Ref: #autosync66042
Node: budget66281
Ref: #budget66405
Node: chart66471
Ref: #chart66590
Node: check66661
Ref: #check66785
Node: check-dates66852
Ref: #check-dates66994
Node: check-dupes67067
Ref: #check-dupes67210
Node: equity67287
Ref: #equity67415
Node: prices67534
Ref: #prices67663
Node: print-unique67718
Ref: #print-unique67867
Node: register-match67960
Ref: #register-match68116
Node: rewrite68214
Ref: #rewrite68335

End Tag Table

View File

@ -518,6 +518,53 @@ OPTIONS
--------------------
-2 EUR
Cost
The -B/--cost flag converts amounts to their cost at transaction time,
if they have a transaction price specified.
Market value
The -V/--value flag converts the reported amounts to their market value
on the report end date, using the most recent applicable market prices,
when known. Specifically, when there is a market price (P directive)
for the amount's commodity, dated on or before the report end date (see
hledger -> Report start & end date), the amount will be converted to
the price's commodity. If multiple applicable prices are defined, the
latest-dated one is used (and if dates are equal, the one last parsed).
For example:
# one euro is worth this many dollars from nov 1
P 2016/11/01 $1.10
# purchase some euros on nov 3
2016/11/3
assets:euros 100
assets:checking
# the euro is worth fewer dollars by dec 21
P 2016/12/21 $1.03
How many euros do I have ?
$ hledger -f t.j bal euros
100 assets:euros
What are they worth on nov 3 ? (no report end date specified, defaults
to the last date in the journal)
$ hledger -f t.j bal euros -V
$110.00 assets:euros
What are they worth on dec 21 ?
$ hledger -f t.j bal euros -V -e 2016/12/21
$103.00 assets:euros
Currently, hledger's -V only uses market prices recorded with P direc-
tives, not transaction prices (unlike Ledger).
Using -B and -V together is allowed.
Regular expressions
hledger uses regular expressions in a number of places:
@ -1022,49 +1069,6 @@ COMMANDS
# Average is rounded to the dollar here since all journal amounts are
Market value
The -V/--value flag converts the reported amounts to their market value
on the report end date, using the most recent applicable market prices,
when known. Specifically, when there is a market price (P directive)
for the amount's commodity, dated on or before the report end date (see
hledger -> Report start & end date), the amount will be converted to
the price's commodity. If multiple applicable prices are defined, the
latest-dated one is used (and if dates are equal, the one last parsed).
For example:
# one euro is worth this many dollars from nov 1
P 2016/11/01 $1.10
# purchase some euros on nov 3
2016/11/3
assets:euros 100
assets:checking
# the euro is worth fewer dollars by dec 21
P 2016/12/21 $1.03
How many euros do I have ?
$ hledger -f t.j bal euros
100 assets:euros
What are they worth on nov 3 ? (no report end date specified, defaults
to the last date in the journal)
$ hledger -f t.j bal euros -V
$110.00 assets:euros
What are they worth on dec 21 ?
$ hledger -f t.j bal euros -V -e 2016/12/21
$103.00 assets:euros
Currently, hledger's -V only uses market prices recorded with P direc-
tives, not transaction prices (unlike Ledger).
Using -B and -V together is allowed.
Custom balance output
In simple (non-multi-column) balance reports, you can customise the
output with --format FMT:

View File

@ -315,6 +315,58 @@ $ hledger balance --pivot member acct:.
-2 EUR
```
## Cost
The `-B/--cost` flag converts amounts to their cost at transaction time,
if they have a [transaction price](/journal.html#transaction-prices) specified.
## Market value
The `-V/--value` flag converts the reported amounts to their market value
on the report end date, using the most recent applicable market prices,
when known.
Specifically, when there is a [market price](journal.html#market-prices) (P directive)
for the amount's commodity, dated on or before the
[report end date](hledger.html#report-start-end-date) (see hledger -> Report start & end date),
the amount will be converted to the price's commodity.
If multiple applicable prices are defined, the latest-dated one is used
(and if dates are equal, the one last parsed).
For example:
```journal
# one euro is worth this many dollars from nov 1
P 2016/11/01 € $1.10
# purchase some euros on nov 3
2016/11/3
assets:euros €100
assets:checking
# the euro is worth fewer dollars by dec 21
P 2016/12/21 € $1.03
```
How many euros do I have ?
```
$ hledger -f t.j bal euros
€100 assets:euros
```
What are they worth on nov 3 ? (no report end date specified, defaults to the last date in the journal)
```
$ hledger -f t.j bal euros -V
$110.00 assets:euros
```
What are they worth on dec 21 ?
```
$ hledger -f t.j bal euros -V -e 2016/12/21
$103.00 assets:euros
```
Currently, hledger's -V only uses market prices recorded with P directives,
not [transaction prices](journal.html#transaction-prices) (unlike Ledger).
Using -B and -V together is allowed.
## Regular expressions
hledger uses [regular expressions](http://www.regular-expressions.info) in a number of places: