Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow 'x' for unknown data, show as '×' #97

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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