X-Git-Url: http://git.shiar.net/barcat.git/blobdiff_plain/c18e3a77d5fd813d9327d6139820a8117c96446d..aa5f3048ba30a813978d33bdee09551e482bd13f:/graph diff --git a/graph b/graph index 781af21..a764afd 100755 --- a/graph +++ b/graph @@ -26,7 +26,8 @@ my @values = map { s/^\h* ( -? [0-9]* (?:\.[0-9]+)? )//x and $1 } @lines; my @order = sort { $b <=> $a } grep { length } @values; if ($opt{trim}) { my $trimpos = abs $opt{trim}; - length > $trimpos and substr($_, $trimpos - 1) = '…' for @lines; + $trimpos == 1 ? ($_ = substr($_, 0, 1)) : + (length > $trimpos and substr($_, $trimpos - 1) = '…') for @lines; } my $maxval = $order[0];