Account balance in Human readable format
This commit is contained in:
parent
3771439131
commit
4b49b97318
|
@ -1 +1,5 @@
|
||||||
curl --request GET --header 'Content-Type: application/json' --header 'Accept: application/json' --header "Authorization: Bearer $AUTH_TOKEN" "https://api.sipgate.com/v2/balance" -s | jq
|
BAL=$(curl --request GET --header 'Content-Type: application/json' --header 'Accept: application/json' --header "Authorization: Bearer $AUTH_TOKEN" "https://api.sipgate.com/v2/balance" -s)
|
||||||
|
AMOUNT=$(echo $BAL | jq '.amount')
|
||||||
|
CUR=$(echo $BAL | jq '.currency' | sed -e 's:"::g' )
|
||||||
|
AMOUNT=$(echo "scale=2; $AMOUNT/10000" | bc -l)
|
||||||
|
echo $CUR $AMOUNT
|
||||||
|
|
Loading…
Reference in a new issue