diff options
author | John Wiegley <johnw@newartisans.com> | 2010-06-07 08:16:02 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2010-06-07 08:32:13 -0400 |
commit | a4d4f9979486eb82c05bd032e1452c2fd400249f (patch) | |
tree | 7451a16c967f4dbe32122bd20f96dc5e6b4ad231 /src/report.cc | |
parent | 8bd362b5d17782cf8fa5317017a1c5d73d76f1b7 (diff) | |
download | fork-ledger-a4d4f9979486eb82c05bd032e1452c2fd400249f.tar.gz fork-ledger-a4d4f9979486eb82c05bd032e1452c2fd400249f.tar.bz2 fork-ledger-a4d4f9979486eb82c05bd032e1452c2fd400249f.zip |
amount_t::print and value_t::print now use flags
Diffstat (limited to 'src/report.cc')
-rw-r--r-- | src/report.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/report.cc b/src/report.cc index 7b9dc956..2ce0ae73 100644 --- a/src/report.cc +++ b/src/report.cc @@ -597,12 +597,17 @@ value_t report_t::fn_truncated(call_scope_t& scope) value_t report_t::fn_justify(call_scope_t& scope) { interactive_t args(scope, "vl&lbb"); + + uint_least8_t flags(AMOUNT_PRINT_NO_FLAGS); + + if (args.has(3) && args.get<bool>(3)) + flags |= AMOUNT_PRINT_RIGHT_JUSTIFY; + if (args.has(4) && args.get<bool>(4)) + flags |= AMOUNT_PRINT_COLORIZE; + std::ostringstream out; args.value_at(0) - .print(out, args.get<int>(1), - args.has(2) ? args.get<int>(2) : -1, - args.has(3) ? args.get<bool>(3) : false, - args.has(4) ? args.get<bool>(4) : false); + .print(out, args.get<int>(1), args.has(2) ? args.get<int>(2) : -1, flags); return string_value(out.str()); } |