Don't show decimals in bitcoin price

This commit is contained in:
ItsDrike 2022-08-25 18:25:48 +02:00
parent 716f2d9ae6
commit f79aba8572
No known key found for this signature in database
GPG key ID: B014E761034AF742

View file

@ -4,7 +4,7 @@ BTC_DATA=$(curl https://api.coindesk.com/v1/bpi/currentprice.json 2>/dev/null ||
if [ "$BTC_DATA" != "ERR" ]; then if [ "$BTC_DATA" != "ERR" ]; then
BTC_PRICE=$(echo $BTC_DATA | jq -r ".bpi.USD.rate_float") BTC_PRICE=$(echo $BTC_DATA | jq -r ".bpi.USD.rate_float")
BTC_PRICE=$(printf "%.2f" "$BTC_PRICE") BTC_PRICE=$(printf "%.0f" "$BTC_PRICE")
echo \$"$BTC_PRICE" echo \$"$BTC_PRICE"
else else
echo "N/A" echo "N/A"