summaryrefslogtreecommitdiff
path: root/src/format.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-14 20:43:28 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-14 20:43:28 -0500
commitbadbeb545b9e700e6656dfbc348bfe1387cb2ffa (patch)
tree26237a150367e13a24917d994602f5f94f979ec8 /src/format.cc
parent73baf9cd727407f6e47b410bbde3b4bcad482ae3 (diff)
parent8d698e5ccb471d546eee8a5bea6d6c56ec4b08c3 (diff)
downloadfork-ledger-badbeb545b9e700e6656dfbc348bfe1387cb2ffa.tar.gz
fork-ledger-badbeb545b9e700e6656dfbc348bfe1387cb2ffa.tar.bz2
fork-ledger-badbeb545b9e700e6656dfbc348bfe1387cb2ffa.zip
Merge branch 'next'
Diffstat (limited to 'src/format.cc')
-rw-r--r--src/format.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/format.cc b/src/format.cc
index e910ce3b..f26a86a1 100644
--- a/src/format.cc
+++ b/src/format.cc
@@ -355,8 +355,11 @@ string format_t::real_calc(scope_t& scope)
}
DEBUG("format.expr", "value = (" << value << ")");
- value.print(out, static_cast<int>(elem->min_width), -1,
- ! elem->has_flags(ELEMENT_ALIGN_LEFT));
+ if (elem->min_width > 0)
+ value.print(out, static_cast<int>(elem->min_width), -1,
+ ! elem->has_flags(ELEMENT_ALIGN_LEFT));
+ else
+ out << value.to_string();
}
catch (const calc_error&) {
add_error_context(_("While calculating format expression:"));