From 5bc1e7746f73b5b1e87230f30f17ac6b8ce539e8 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Mon, 19 Aug 2019 11:16:09 +0100 Subject: [PATCH] stats: show count of market prices (P), and the commodities covered --- hledger/Hledger/Cli/Commands/Stats.hs | 4 +++- hledger/Hledger/Cli/Commands/Stats.md | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hledger/Hledger/Cli/Commands/Stats.hs b/hledger/Hledger/Cli/Commands/Stats.hs index 755c4ccb7..75d500748 100644 --- a/hledger/Hledger/Cli/Commands/Stats.hs +++ b/hledger/Hledger/Cli/Commands/Stats.hs @@ -70,6 +70,7 @@ showLedgerStats l today span = ,("Payees/descriptions", show $ size $ fromList $ map (tdescription) ts) ,("Accounts", printf "%d (depth %d)" acctnum acctdepth) ,("Commodities", printf "%s (%s)" (show $ length cs) (T.intercalate ", " cs)) + ,("Market prices", printf "%s (%s)" (show $ length mktprices) (T.intercalate ", " mktpricecommodities)) -- Transactions this month : %(monthtxns)s (last month in the same period: %(lastmonthtxns)s) -- Unmarked transactions : %(unmarked)s -- Days since reconciliation : %(reconcileelapsed)s @@ -106,4 +107,5 @@ showLedgerStats l today span = acctnum = length as acctdepth | null as = 0 | otherwise = maximum $ map accountNameLevel as - + mktprices = jpricedirectives j + mktpricecommodities = nub $ sort $ map pdcommodity mktprices diff --git a/hledger/Hledger/Cli/Commands/Stats.md b/hledger/Hledger/Cli/Commands/Stats.md index 6d5678464..c1155c7dd 100644 --- a/hledger/Hledger/Cli/Commands/Stats.md +++ b/hledger/Hledger/Cli/Commands/Stats.md @@ -21,6 +21,7 @@ Transactions last 7 days : 0 (0.0 per day) Payees/descriptions : 5 Accounts : 8 (depth 3) Commodities : 1 ($) +Market prices : 12 ($) ``` This command also supports