On Thursday, March 15, 2012 2:07:57 AM UTC-7, John Wiegley wrote:
>
> Parent is null when it gets to "root" account (which contain the final 
> total
> at the bottom).
>
Ah, gotcha.  So either wrapping it in a test like you did, or
just indicating we don't want a total would work.  A variation
that I liked after playing around with the format a bit:

$ ledger balance Allocation -X '$' --no-total --format \
"%8(__tmp = market(parent.total, value_date, exchange);"\
" ((partial_account & parent & __tmp) ?"\
"   percent(scrub(market(total, value_date, exchange)), "\
"           scrub(__tmp)) : 0))    "\
"%14(market(display_total))"\
"%(depth_spacer)  "\
"%(partial_account)\n";
 

Reply via email to