Indicate ignored (non-numeric) rows if any. Unchanged otherwise.
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),
2019-08-22 1.1083 ------------------
2019-08-21 1.1104 -----------------------
2019-08-20 1.1076 -----------------
-23.1939 of 6386.71270000003 total in 5373 values (0.8252 min, 1.20 avg, 1.5990 max)
+23.1939 of 6386.71270000003 total in 5306 values over 5373 lines (0.8252 min, 1.20 avg, 1.5990 max)
--7.4589999998 total in 18 values (-3 min, -0.47 avg, 2 max)
+-7.4589999998 total in 16 values over 18 lines (-3 min, -0.47 avg, 2 max)
--- /dev/null
+t1008-unicode.in
\ No newline at end of file
--- /dev/null
+ 920 B -<-
+ 476 C -<
+ 619 Ĉ -<
+2094 D -<----+
+6552 E -<----+-=--->----------
+1062 F -<--
+ 766 G -<-
+ 738 Ĝ -<-
+ 371 H -
+ 7 Ĥ
+5513 I -<----+-=--->-------
+1140 J -<--
+ 38 Ĵ
+2558 K -<----+-=
+4253 L -<----+-=--->--
+2183 M -<----+-
+6321 N -<----+-=--->---------
+8110 O -<----+-=--->----------------
+2266 P -<----+-
+4387 R -<----+-=--->---
+5462 S -<----+-=--->------
+ 331 Ŝ -
+3534 T -<----+-=--->
+2579 U -<----+-=
+ 320 Ŭ -
+1458 V -<---
+ 383 Z -
+# 23731 whitespace
+4217 … -<----+-=--->--
+\r0
+68658 of 77982 total in 29 values over 31 lines (7 min, 2689.03 avg, 9324 max)
\e[90m 1\e[0m-2 -------\e[36m<\e[0m--\e[36m=\e[0m-\e[36m|\e[0m-----
\e[90m -2.0\e[0m ----
--1 -------\e[36m<\e[0m--\e[36m=\e[0m-\e[36m|\e[0m
-\e[1m-7.4589999998\e[0m total in 18 values (\e[31m-3\e[0m min, \e[36m-0.47\e[0m avg, \e[32m2\e[0m max)
+\e[1m-7.4589999998\e[0m total in 16 values over 18 lines (\e[31m-3\e[0m min, \e[36m-0.47\e[0m avg, \e[32m2\e[0m max)
2019-08-22\e[90m 1.1083\e[0m ------------------
2019-08-21\e[32m 1.1104\e[0m -----------------------
2019-08-20\e[90m 1.1076\e[0m -----------------
-23.1939 of \e[1m6386.71270000003\e[0m total in 5373 values (\e[31m0.8252\e[0m min, \e[36m1.20\e[0m avg, \e[32m1.5990\e[0m max)
+23.1939 of \e[1m6386.71270000003\e[0m total in 5306 values over 5373 lines (\e[31m0.8252\e[0m min, \e[36m1.20\e[0m avg, \e[32m1.5990\e[0m max)