Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions spark
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
}
Expand Down