X-Git-Url: http://git.shiar.nl/barcat.git/blobdiff_plain/704f0f343df103c321caa2ea7e846dea650cd24e..dadf1e71a2fb2f1f331d830636d286ab98b4034a:/barcat diff --git a/barcat b/barcat index fc4cb3c..5676228 100755 --- a/barcat +++ b/barcat @@ -273,12 +273,13 @@ sub show_stat { if ($opt{hidemin} or $opt{hidemax}) { $opt{hidemin} ||= 1; $opt{hidemax} ||= @lines; - printf '%s of ', sum(@values[$opt{hidemin} - 1 .. $opt{hidemax} - 1]) // 0; + printf '%s of ', sum(grep {length} @values[$opt{hidemin} - 1 .. $opt{hidemax} - 1]) // 0; } if (@order) { my $total = sum @order; printf '%s total', color(1) . $total . color(0); - printf ' in %d values', scalar @values; + printf ' in %d values', scalar @order; + printf ' over %d lines', scalar @lines if @order != @lines; printf(' (%s min, %s avg, %s max)', color(31) . $order[-1] . color(0), color(36) . (sprintf '%*.*f', 0, 2, $total / @order) . color(0),