chubin / rate.sx

:moneybag: curl cryptocurrencies exchange rates
http://rate.sx
MIT License
980 stars 88 forks source link

Remove numbers after decimal?! #35

Open Dan1jel opened 3 years ago

Dan1jel commented 3 years ago

Would wish there was an option to remove decimals and all numbers after. I'm not interested in the whole number because I'm having this in my tmux config.

Didn't see any option for this if this maybe is easy to implement?

chubin commented 3 years ago

@Dan1jel Can you please give me an example? How it is now, and what you would like to have>

Dan1jel commented 3 years ago

@Dan1jel Can you please give me an example? How it is now, and what you would like to have>

Sure, when i do
curl sek.rate.sx/1btc I get 403744.714135

I would like it to be only 403744 because this is 403 thousand 7 hundred 44kr, and that's all I'm interested in.

I do have some bitcoins (0.00229537)

And this is not a huge amount, but i only interested in the hunders, not cents.

curl sek.rate.sx/0.00229537btc Is 929.780626361

Should just be 929.

chubin commented 3 years ago

This could be possible, but with a format option (not by default); think about curl btc.wttr.in/1sek. So probably something like: curl btc.wttr.in/1sek?format=%2.3f would be good; what do you think?

Dan1jel commented 3 years ago

I do use curl wttr.in/xxx?format=3 atm in terminal so that would be a good option.

chubin commented 3 years ago

Very good! Accepted