From bb044f882056aac97cba6f3046370c514852f1db Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sat, 14 Aug 2004 00:32:44 -0400 Subject: [PATCH] fix to amount printing --- amount.cc | 4 +++- format.cc | 8 ++++---- main.cc | 7 ++++++- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/amount.cc b/amount.cc index 00610c05..b8b5451a 100644 --- a/amount.cc +++ b/amount.cc @@ -525,7 +525,9 @@ std::ostream& operator<<(std::ostream& out, const amount_t& amt) bool printed = false; - for (strings_list::iterator i = strs.begin(); i != strs.end(); i++) { + for (strings_list::reverse_iterator i = strs.rbegin(); + i != strs.rend(); + i++) { if (printed) { out << (amt.commodity->flags & COMMODITY_STYLE_EUROPEAN ? '.' : ','); out.width(3); diff --git a/format.cc b/format.cc index fde8743f..13ae0235 100644 --- a/format.cc +++ b/format.cc @@ -327,10 +327,10 @@ bool format_account::disp_subaccounts_p(const account_t * account, for (accounts_map::const_iterator i = account->accounts.begin(); i != account->accounts.end(); i++) { - // jww (2004-08-03): How do compute the right figure? It should a - // value expression specified by the user, to say, "If this - // expression is equivalent between a parent account and a lone - // displayed child, then don't display the parent." + // jww (2004-08-03): How to compute the right figure? It should + // be a value expression specified by the user which says, "If + // this expression is equivalent between a parent account and a + // lone displayed child, don't display the parent." if (! (*i).second->total || ! disp_pred((*i).second)) continue; diff --git a/main.cc b/main.cc index c08b71b1..b0d6e96b 100644 --- a/main.cc +++ b/main.cc @@ -204,6 +204,11 @@ OPT_BEGIN(file, "f:", true) { use_cache = false; } OPT_END(file); +#if 0 +OPT_BEGIN(cache, ":") { +} OPT_END(cache); +#endif + OPT_BEGIN(output, "o:", false) { if (std::string(optarg) != "-") output_stream.reset(new std::ofstream(optarg)); @@ -448,7 +453,7 @@ int main(int argc, char * argv[], char * envp[]) TIMER_START(read_cache); - // jww (2004-08-13): use LEDGER_FILE + // jww (2004-08-13): use LEDGER_FILE and LEDGER_CACHE use_cache = std::getenv("LEDGER") != NULL; if (use_cache) {