Justify integers correctly when printing
This commit is contained in:
parent
bfa2691583
commit
4fe4a33bf8
1 changed files with 8 additions and 6 deletions
10
src/value.cc
10
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: {
|
||||
if (as_amount().is_zero()) {
|
||||
out.width(first_width);
|
||||
out << std::right << 0L;
|
||||
} else {
|
||||
std::ostringstream buf;
|
||||
if (as_amount().is_zero())
|
||||
buf << 0L;
|
||||
else
|
||||
buf << as_amount();
|
||||
justify(out, buf.str(), first_width, true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue