From 74e569e220bee08d6c9eda59b5e4021748344994 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 26 Feb 2009 00:10:08 -0400 Subject: Added a truncated() method for amounts and values When an amount is truncated, it drops all of the extra precision and becomes exactly the value would have seen were it printed. --- src/balance.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/balance.h') diff --git a/src/balance.h b/src/balance.h index a9684796..f8e4f25c 100644 --- a/src/balance.h +++ b/src/balance.h @@ -318,6 +318,13 @@ public: return temp; } + balance_t truncated() const { + balance_t temp; + foreach (const amounts_map::value_type& pair, amounts) + temp += pair.second.truncated(); + return temp; + } + balance_t unrounded() const { balance_t temp; foreach (const amounts_map::value_type& pair, amounts) -- cgit v1.2.3