From d0299d453a5bd5416dc4bb88ec4da03a35cf3144 Mon Sep 17 00:00:00 2001 From: Uli Martens Date: Sun, 4 Mar 2018 20:26:07 +0100 Subject: [PATCH] =?UTF-8?q?Allow=20'x'=20for=20unknown=20data,=20show=20as?= =?UTF-8?q?=20'=C3=97'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spark | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/spark b/spark index 53a38be..d8da888 100755 --- a/spark +++ b/spark @@ -49,9 +49,11 @@ spark() # on Linux (or with bash4) we could use `printf %.0f $n` here to # round the number but that doesn't work on OS X (bash3) nor does # `awk '{printf "%.0f",$1}' <<< $n` work, so just cut it off - n=${n%.*} - (( n < min )) && min=$n - (( n > max )) && max=$n + if [ $n != x ]; then + n=${n%.*} + (( n < min )) && min=$n + (( n > max )) && max=$n + fi numbers=$numbers${numbers:+ }$n done @@ -66,7 +68,11 @@ spark() for n in $numbers do - _echo -n ${ticks[$(( ((($n-$min)<<8)/$f) ))]} + if [ $n = x ]; then + _echo -n × + else + _echo -n ${ticks[$(( ((($n-$min)<<8)/$f) ))]} + fi done _echo }