Article 5EY3R remove all numbers after the .

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?
Thankslatest?d=yIl2AUoC8zA latest?i=uY_ycf2kSl0:ywGetyWUwfk:F7zBnMy latest?i=uY_ycf2kSl0:ywGetyWUwfk:V_sGLiP latest?d=qj6IDK7rITs latest?i=uY_ycf2kSl0:ywGetyWUwfk:gIN9vFwuY_ycf2kSl0
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments