summaryrefslogtreecommitdiff
path: root/src/balance.h
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2012-10-25 22:28:26 -0700
committerCraig Earls <enderw88@gmail.com>2012-10-25 22:28:26 -0700
commitb044a74bd34afdc27baf6241fe398690ff5e043a (patch)
tree6cf2168e51611a86e04d834b2a507322a8a8fe04 /src/balance.h
parent4b261f99bc56853b3468a8a1bb5b4af39ed67af5 (diff)
downloadfork-ledger-b044a74bd34afdc27baf6241fe398690ff5e043a.tar.gz
fork-ledger-b044a74bd34afdc27baf6241fe398690ff5e043a.tar.bz2
fork-ledger-b044a74bd34afdc27baf6241fe398690ff5e043a.zip
Bug 634 and 488, Corrected behavior of floor, and added ceiling
This is only a partial fix for 634, since rounding is not fixed.
Diffstat (limited to 'src/balance.h')
-rw-r--r--src/balance.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/balance.h b/src/balance.h
index 230a4e2c..9635742d 100644
--- a/src/balance.h
+++ b/src/balance.h
@@ -345,6 +345,17 @@ public:
pair.second.in_place_floor();
}
+ balance_t ceilinged() const {
+ balance_t temp(*this);
+ temp.in_place_ceiling();
+ return temp;
+ }
+ void in_place_ceiling() {
+ foreach (amounts_map::value_type& pair, amounts)
+ pair.second.in_place_ceiling();
+ }
+
+
balance_t unrounded() const {
balance_t temp(*this);
temp.in_place_unround();