remove all numbers after the .
by aristosv from LinuxQuestions.org on (#5EY3R)
In a bash script, I am pulling the price of BTC against USDT like this:
Code:curl -s https://api.binance.com/api/v1/ticker/price?symbol=BTCUSDTAnd this is the output:
Code:{"symbol":"BTCUSDT","price":"49634.04000000"}I just need the number though, so I filter everything else using this:
Code:curl -s https://api.binance.com/api/v1/ticker/price?symbol=BTCUSDT | grep -o "[0-9.]\+"And this is the output:
Code:49541.87000000Now I need to remove all the numbers after the .
No rounding up or down or anything, I just need to remove everything after the .
How can I do that?
Thanks


Code:curl -s https://api.binance.com/api/v1/ticker/price?symbol=BTCUSDTAnd this is the output:
Code:{"symbol":"BTCUSDT","price":"49634.04000000"}I just need the number though, so I filter everything else using this:
Code:curl -s https://api.binance.com/api/v1/ticker/price?symbol=BTCUSDT | grep -o "[0-9.]\+"And this is the output:
Code:49541.87000000Now I need to remove all the numbers after the .
No rounding up or down or anything, I just need to remove everything after the .
How can I do that?
Thanks