From 5d4a0a39bee1fd1abd1a04e0614c75755df4485d Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sat, 21 Nov 2009 02:06:01 -0500 Subject: The Python web server now uses jQuery Tablesorter --- src/balance.h | 4 ++-- src/value.cc | 17 ++++++++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/balance.h b/src/balance.h index a8a46d53..826de134 100644 --- a/src/balance.h +++ b/src/balance.h @@ -541,8 +541,8 @@ public: void print(std::ostream& out, const int first_width = -1, const int latter_width = -1, - const bool right_justify = true, - const bool colorize = true) const; + const bool right_justify = false, + const bool colorize = false) const; /** * Debugging methods. There are two methods defined to help with diff --git a/src/value.cc b/src/value.cc index e2e748f4..cce4c4e8 100644 --- a/src/value.cc +++ b/src/value.cc @@ -1114,18 +1114,18 @@ void value_t::in_place_cast(type_t cast_type) break; } - case BALANCE: + case BALANCE: { + const balance_t& bal(as_balance()); switch (cast_type) { case AMOUNT: { - const balance_t& temp(as_balance()); - if (temp.amounts.size() == 1) { + if (bal.amounts.size() == 1) { // Because we are changing the current balance value to an amount // value, and because set_amount takes a reference (and that memory is // about to be repurposed), we must pass in a copy. - set_amount(amount_t((*temp.amounts.begin()).second)); + set_amount(amount_t((*bal.amounts.begin()).second)); return; } - else if (temp.amounts.size() == 0) { + else if (bal.amounts.size() == 0) { set_amount(0L); return; } @@ -1135,10 +1135,17 @@ void value_t::in_place_cast(type_t cast_type) } break; } + case STRING: + if (bal.is_empty()) + set_string(""); + else + set_string(as_balance().to_string()); + return; default: break; } break; + } case STRING: switch (cast_type) { -- cgit v1.2.3