summaryrefslogtreecommitdiff
path: root/src/balance.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/balance.cc')
-rw-r--r--src/balance.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/balance.cc b/src/balance.cc
index 07657287..274f860a 100644
--- a/src/balance.cc
+++ b/src/balance.cc
@@ -203,6 +203,16 @@ balance_t::value(const bool primary_only,
return resolved ? temp : optional<balance_t>();
}
+balance_t balance_t::price() const
+{
+ balance_t temp;
+
+ foreach (const amounts_map::value_type& pair, amounts)
+ temp += pair.second.price();
+
+ return temp;
+}
+
optional<amount_t>
balance_t::commodity_amount(const optional<const commodity_t&>& commodity) const
{