summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-10-27 17:30:53 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-10-27 17:30:53 -0400
commitcbf8f355d16224bc119e2d41a22a1d0b9d7bf0ff (patch)
tree4e5a28db052c279665bf0df23bd25bf44899668d
parent12616dd030811b79b4e4270628fff3d478bf7074 (diff)
downloadledger-cbf8f355d16224bc119e2d41a22a1d0b9d7bf0ff.tar.gz
ledger-cbf8f355d16224bc119e2d41a22a1d0b9d7bf0ff.tar.bz2
ledger-cbf8f355d16224bc119e2d41a22a1d0b9d7bf0ff.zip
In budget report, color large percentages magenta
-rw-r--r--src/report.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/report.h b/src/report.h
index 8c66c88a..c0c8c4a6 100644
--- a/src/report.h
+++ b/src/report.h
@@ -378,15 +378,31 @@ public:
on(none,
"%(justify(scrub(get_at(total_expr, 0)), 12, -1, true, color))"
" %(justify(scrub(- get_at(total_expr, 1)), 12, -1, true, color))"
- " %(justify(scrub(get_at(total_expr, 1) + get_at(total_expr, 0)), 12, -1, true, color))"
- " %(justify(scrub((100% * get_at(total_expr, 0)) / - get_at(total_expr, 1)), 5, -1, true, color))"
+ " %(justify(scrub(get_at(total_expr, 1) + "
+ " get_at(total_expr, 0)), 12, -1, true, color))"
+ " %(ansify_if("
+ " justify((get_at(total_expr, 1) ? "
+ " scrub((100% * get_at(total_expr, 0)) / "
+ " - get_at(total_expr, 1)) : 0), "
+ " 5, -1, true, false),"
+ " magenta if (color and get_at(total_expr, 1) and "
+ " (abs(quantity(get_at(total_expr, 0)) / "
+ " quantity(get_at(total_expr, 1))) >= 1))))"
" %(!options.flat ? depth_spacer : \"\")"
"%-(ansify_if(partial_account(options.flat), blue if color))\n"
"%/"
"%(justify(scrub(get_at(total_expr, 0)), 12, -1, true, color))"
" %(justify(scrub(- get_at(total_expr, 1)), 12, -1, true, color))"
- " %(justify(scrub(get_at(total_expr, 1) + get_at(total_expr, 0)), 12, -1, true, color))"
- " %(justify(scrub((100% * get_at(total_expr, 0)) / - get_at(total_expr, 1)), 5, -1, true, color))\n%/"
+ " %(justify(scrub(get_at(total_expr, 1) + "
+ " get_at(total_expr, 0)), 12, -1, true, color))"
+ " %(ansify_if("
+ " justify((get_at(total_expr, 1) ? "
+ " scrub((100% * get_at(total_expr, 0)) / "
+ " - get_at(total_expr, 1)) : 0), "
+ " 5, -1, true, false),"
+ " magenta if (color and get_at(total_expr, 1) and "
+ " (abs(quantity(get_at(total_expr, 0)) / "
+ " quantity(get_at(total_expr, 1))) >= 1))))\n%/"
"------------ ------------ ------------ -----\n");
});