Send the bc check to /dev/null
This commit is contained in:
parent
d8980a0a9c
commit
9e06d7a0fd
|
@ -166,7 +166,7 @@ convertCurrency()
|
|||
{
|
||||
exchangeTo=$(echo "$exchangeTo" | tr '[:upper:]' '[:lower:]')
|
||||
exchangeRate=$(httpGet "https://api.coinmarketcap.com/v1/ticker/$reqId/?convert=$exchangeTo" | grep -Eo "\"price_$exchangeTo\": \"[0-9 .]*" | sed s/"\"price_$exchangeTo\": \""//g) > /dev/null
|
||||
if ! command -v bc; then
|
||||
if ! command -v bc &>/dev/null; then
|
||||
exchangeRate=$(echo $exchangeRate | grep -Eo "[0-9]*" )
|
||||
exchangeAmount=$(( $exchangeRate * $amount ))
|
||||
else
|
||||
|
|
|
@ -137,13 +137,13 @@ checkInternet()
|
|||
convertCurrency()
|
||||
{
|
||||
exchangeRate=$(httpGet "http://api.fixer.io/latest?base=$base&symbols=$exchangeTo" | grep -Eo "[0-9]*[.][0-9]*") > /dev/null
|
||||
if ! command -v bc; then
|
||||
if ! command -v bc &>/dev/null; then
|
||||
exchangeRate=$(echo $exchangeRate | grep -Eo "[0-9]*" )
|
||||
exchangeAmount=$(( $exchangeRate * $amount ))
|
||||
else
|
||||
exchangeAmount=$( echo "$exchangeRate * $amount" | bc )
|
||||
fi
|
||||
|
||||
|
||||
cat <<EOF
|
||||
|
||||
=========================
|
||||
|
|
Loading…
Reference in New Issue