From e32d9e64a768f276e04fe79c14f1b28d88bd4185 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 8 Mar 2006 18:24:56 +0000 Subject: Added much better error location. --- balance.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'balance.h') diff --git a/balance.h b/balance.h index f2d78233..71929f13 100644 --- a/balance.h +++ b/balance.h @@ -416,6 +416,16 @@ class balance_t if ((*i).second.commodity()) (*i).second = (*i).second.round(); } + + balance_t unround() const { + balance_t temp; + for (amounts_map::const_iterator i = amounts.begin(); + i != amounts.end(); + i++) + if ((*i).second.commodity()) + temp += (*i).second.unround(); + return temp; + } }; inline balance_t abs(const balance_t& bal) { @@ -847,6 +857,13 @@ class balance_pair_t quantity.round(); if (cost) cost->round(); } + + balance_pair_t unround() { + balance_pair_t temp(quantity.unround()); + if (cost) + temp.cost = new balance_t(cost->unround()); + return temp; + } }; inline balance_pair_t abs(const balance_pair_t& bal_pair) { -- cgit v1.2.3