diff options
Diffstat (limited to 'balance.h')
-rw-r--r-- | balance.h | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -449,6 +449,19 @@ class balance_t (*i).second.abs(); } + void reduce() { + for (amounts_map::iterator i = amounts.begin(); + i != amounts.end(); + i++) + (*i).second.reduce(); + } + + balance_t reduced() const { + balance_t temp(*this); + temp.reduce(); + return temp; + } + void round() { for (amounts_map::iterator i = amounts.begin(); i != amounts.end(); @@ -893,6 +906,17 @@ class balance_pair_t return quantity.valid() && (! cost || cost->valid()); } + void reduce() { + quantity.reduce(); + if (cost) cost->reduce(); + } + + balance_pair_t reduced() const { + balance_pair_t temp(*this); + temp.reduce(); + return temp; + } + void round() { quantity.round(); if (cost) cost->round(); |