From 04fd1ae24c3be6f9d3400c55bce90c3fd743e96b Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 22 Feb 2009 03:14:58 -0400 Subject: Fixed the way values are justified for printing --- src/balance.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/balance.cc') diff --git a/src/balance.cc b/src/balance.cc index b8009607..b8e4e07d 100644 --- a/src/balance.cc +++ b/src/balance.cc @@ -215,7 +215,8 @@ balance_t::strip_annotations(const keep_details_t& what_to_keep) const void balance_t::print(std::ostream& out, const int first_width, - const int latter_width) const + const int latter_width, + const bool right_justify) const { bool first = true; int lwidth = latter_width; @@ -244,13 +245,12 @@ void balance_t::print(std::ostream& out, std::ostringstream buf; buf << *amount; - justify(out, buf.str(), width, true); + justify(out, buf.str(), width, right_justify); } if (first) { - std::ostringstream buf; - buf << amount_t(0L); - justify(out, buf.str(), first_width, true); + out.width(first_width); + out << (right_justify ? std::right : std::left) << 0; } } -- cgit v1.2.3