summaryrefslogtreecommitdiff
path: root/balance.h
diff options
context:
space:
mode:
Diffstat (limited to 'balance.h')
-rw-r--r--balance.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/balance.h b/balance.h
index 8141c3b7..28423a64 100644
--- a/balance.h
+++ b/balance.h
@@ -314,6 +314,31 @@ public:
return temp;
}
+ balance_t round() const {
+ balance_t temp;
+ for (amounts_map::const_iterator i = amounts.begin();
+ i != amounts.end();
+ i++)
+ temp += i->second.round();
+ return temp;
+ }
+ balance_t round(amount_t::precision_t prec) const {
+ balance_t temp;
+ for (amounts_map::const_iterator i = amounts.begin();
+ i != amounts.end();
+ i++)
+ temp += i->second.round(prec);
+ return temp;
+ }
+ balance_t unround() const {
+ balance_t temp;
+ for (amounts_map::const_iterator i = amounts.begin();
+ i != amounts.end();
+ i++)
+ temp += i->second.unround();
+ return temp;
+ }
+
balance_t reduce() const {
balance_t temp(*this);
temp.in_place_reduce();