summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/value.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/value.cc b/src/value.cc
index d04e5ef9..a7d3c7e5 100644
--- a/src/value.cc
+++ b/src/value.cc
@@ -1303,16 +1303,18 @@ void value_t::print(std::ostream& out,
break;
case INTEGER:
- out << as_long();
+ out << std::right << as_long();
break;
case AMOUNT: {
- std::ostringstream buf;
- if (as_amount().is_zero())
- buf << 0L;
- else
+ if (as_amount().is_zero()) {
+ out.width(first_width);
+ out << std::right << 0L;
+ } else {
+ std::ostringstream buf;
buf << as_amount();
- justify(out, buf.str(), first_width, true);
+ justify(out, buf.str(), first_width, true);
+ }
break;
}