From 115da191214638299eced2564fa4bd5c6c03c63f Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 10 Nov 2009 01:27:46 -0500 Subject: account.amount and .total return simplified values --- src/account.cc | 4 ++-- src/value.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/account.cc b/src/account.cc index 43b7cd56..5cc7e070 100644 --- a/src/account.cc +++ b/src/account.cc @@ -180,11 +180,11 @@ namespace { } value_t get_amount(account_t& account) { - return VALUE_OR_ZERO(account.amount()); + return SIMPLIFIED_VALUE_OR_ZERO(account.amount()); } value_t get_total(account_t& account) { - return VALUE_OR_ZERO(account.total()); + return SIMPLIFIED_VALUE_OR_ZERO(account.total()); } value_t get_subcount(account_t& account) { diff --git a/src/value.h b/src/value.h index 94002bef..96a3078a 100644 --- a/src/value.h +++ b/src/value.h @@ -946,6 +946,8 @@ inline value_t string_value(const string& str = "") { } #define VALUE_OR_ZERO(val) ((val).is_null() ? value_t(0L) : (val)) +#define SIMPLIFIED_VALUE_OR_ZERO(val) \ + ((val).is_null() ? value_t(0L) : (val).simplified()) inline value_t mask_value(const string& str) { return value_t(mask_t(str)); -- cgit v1.2.3