diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-22 03:14:58 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-22 04:51:11 -0400 |
commit | 04fd1ae24c3be6f9d3400c55bce90c3fd743e96b (patch) | |
tree | 25d1ad1adfd755b41ee1f24b3177a2d11219e714 /src/balance.cc | |
parent | 640279c65d638d777852a291d674c342a9b8115e (diff) | |
download | fork-ledger-04fd1ae24c3be6f9d3400c55bce90c3fd743e96b.tar.gz fork-ledger-04fd1ae24c3be6f9d3400c55bce90c3fd743e96b.tar.bz2 fork-ledger-04fd1ae24c3be6f9d3400c55bce90c3fd743e96b.zip |
Fixed the way values are justified for printing
Diffstat (limited to 'src/balance.cc')
-rw-r--r-- | src/balance.cc | 10 |
1 files changed, 5 insertions, 5 deletions
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; } } |