Fix currency parsing

Allow for more than one token of digit before decimal
This commit is contained in:
Alex Epstein 2017-06-28 09:07:37 -04:00
parent 222ff1af08
commit 4ddcc644e4
1 changed files with 1 additions and 1 deletions

View File

@ -122,7 +122,7 @@ checkInternet()
## Grabs the exchange rate and does the math for converting the currency
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 )
echo
echo "========================="