From afe87280e091d4f094f068c5f21aecccd2d1831b Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 11 Nov 2009 03:39:53 -0500 Subject: Added floored() and in_place_floor() methods --- src/balance.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/balance.h') diff --git a/src/balance.h b/src/balance.h index 81a7ff13..8a40dea9 100644 --- a/src/balance.h +++ b/src/balance.h @@ -339,6 +339,18 @@ public: *this = temp; } + balance_t floored() const { + balance_t temp(*this); + temp.in_place_floor(); + return temp; + } + void in_place_floor() { + balance_t temp; + foreach (const amounts_map::value_type& pair, amounts) + temp += pair.second.floored(); + *this = temp; + } + balance_t unrounded() const { balance_t temp(*this); temp.in_place_unround(); -- cgit v1.2.3