File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ for symbol in $(IFS=' '; echo "${SYMBOLS[*]}" | tr '[:lower:]' '[:upper:]'); do
72
72
preMarketChange=" $( query $symbol ' preMarketChange' ) "
73
73
postMarketChange=" $( query $symbol ' postMarketChange' ) "
74
74
75
- if [ $marketState == " PRE" ] \
75
+ if [ $marketState = " PRE" ] \
76
76
&& [ $preMarketChange != " 0" ] \
77
77
&& [ $preMarketChange != " null" ]; then
78
78
nonRegularMarketSign=' *'
@@ -93,7 +93,11 @@ for symbol in $(IFS=' '; echo "${SYMBOLS[*]}" | tr '[:lower:]' '[:upper:]'); do
93
93
percent=$( query $symbol ' regularMarketChangePercent' )
94
94
fi
95
95
96
- if [ " $diff " == " 0" ] || [ " $diff " == " 0.0" ]; then
96
+ # see https://github.com/pstadler/ticker.sh/issues/40
97
+ [ " $diff " = " null" ] && diff=" 0.0"
98
+ [ " $percent " = " null" ] && percent=" 0.0"
99
+
100
+ if [ " $diff " = " 0" ] || [ " $diff " = " 0.0" ]; then
97
101
color=
98
102
elif ( echo " $diff " | grep -q ^- ); then
99
103
color=$COLOR_RED
You can’t perform that action at this time.
0 commit comments