Fix currency parsing
Allow for more than one token of digit before decimal
This commit is contained in:
parent
222ff1af08
commit
4ddcc644e4
|
@ -122,7 +122,7 @@ checkInternet()
|
||||||
## Grabs the exchange rate and does the math for converting the currency
|
## Grabs the exchange rate and does the math for converting the currency
|
||||||
convertCurrency()
|
convertCurrency()
|
||||||
{
|
{
|
||||||
exchangeRate=$(curl -s "http://api.fixer.io/latest?base=$base&symbols=$exchangeTo" | grep -Eo "[0-9][.][0-9]*") > /dev/null
|
exchangeRate=$(curl -s "http://api.fixer.io/latest?base=$base&symbols=$exchangeTo" | grep -Eo "[0-9]*[.][0-9]*") > /dev/null
|
||||||
exchangeAmount=$(echo "$exchangeRate * $amount" | bc )
|
exchangeAmount=$(echo "$exchangeRate * $amount" | bc )
|
||||||
echo
|
echo
|
||||||
echo "========================="
|
echo "========================="
|
||||||
|
|
Loading…
Reference in New Issue