Compensate for cumulative floating point errors showing up.
}
if (@order) {
my $total = sum @order;
- printf '%s total', color(1) . $total . color(0);
+ printf '%s total', color(1) . sprintf('%.8g', $total) . color(0);
printf ' in %d values', scalar @order;
printf ' over %d lines', scalar @lines if @order != @lines;
printf(' (%s min, %s avg, %s max)',
2019-08-22 1.1083 ------------------
2019-08-21 1.1104 -----------------------
2019-08-20 1.1076 -----------------
-23.1939 of 6386.71270000003 total in 5306 values over 5373 lines (0.8252 min, 1.20 avg, 1.5990 max)
+23.1939 of 6386.7127 total in 5306 values over 5373 lines (0.8252 min, 1.20 avg, 1.5990 max)
--7.4589999998 total in 16 values over 18 lines (-3 min, -0.47 avg, 2 max)
+-7.459 total in 16 values over 18 lines (-3 min, -0.47 avg, 2 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 16 values over 18 lines (\e[31m-3\e[0m min, \e[36m-0.47\e[0m avg, \e[32m2\e[0m max)
+\e[1m-7.459\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 5306 values over 5373 lines (\e[31m0.8252\e[0m min, \e[36m1.20\e[0m avg, \e[32m1.5990\e[0m max)
+23.1939 of \e[1m6386.7127\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)