From 5e3f3d7f4730dd2990b6b56352e4a09cdde9a234 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 5 Nov 2009 17:40:07 -0500 Subject: Report sought magnitude when balancing errors occur --- src/balance.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/balance.h') diff --git a/src/balance.h b/src/balance.h index 36a6907a..a4f922a8 100644 --- a/src/balance.h +++ b/src/balance.h @@ -480,6 +480,13 @@ public: optional commodity_amount(const optional& commodity = none) const; + balance_t number() const { + balance_t temp; + foreach (const amounts_map::value_type& pair, amounts) + temp += pair.second.number(); + return temp; + } + /** * Annotated commodity methods. The amounts contained by a balance * may use annotated commodities. The `strip_annotations' method -- cgit v1.2.3