Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Parameterize for other currencies #1

Closed
westonal opened this issue Dec 4, 2017 · 4 comments
Closed

Feature request: Parameterize for other currencies #1

westonal opened this issue Dec 4, 2017 · 4 comments

Comments

@westonal
Copy link

westonal commented Dec 4, 2017

Something like:

curl rate.sx/CAD
curl rate.sx/GBP
@chubin
Copy link
Owner

chubin commented Dec 4, 2017

Yes, I'm already working on it. The feature will be released soon.

@chubin
Copy link
Owner

chubin commented Dec 5, 2017

@westonal I've added initial support of currencies. There are some things to be completed,
so I don't release the feature (not yet). Could you play with it a little bit, and give me some feedback?

I've added support for ten different (I believe, most important) currencies:
AUD, CAD, CHF, CNY, EUR, GBP, IDR, JPY, KRW, RUB

If you choose one of them, you will get your output in that currency.

How do you choose a currency?

$ curl eur.rate.sx
$ curl gbp.rate.sx
$ curl cad.rate.sx

(it does not matter if you use the upper or the lower case; you can mix them: EUR.rate.sx is ok; CaD.Rate.SX is also ok).

If you use some unknown currency, it silently uses USD. So be careful here (probably, we should print some warning or even error in this case?).

For dollars (USD, AUD, CAD) you have '$' in front of the numbers in the headers (Market Cap: $351,742,820,072). You have to know, what $ is ment here (because you issue the query). I don't know, if it is correct. I suppose yes, in Canada and Australia the $ sign is used for local currencies, right?

Open questions at the moment (things to be implemented):

  • 1h and 24h changes are calculated basing on the current currency rate, what is strictly speaking wrong, but not really critical, because these currencies are not really volatile (this bug will be fixed soon; I just want to warn you) (and this bug is critical if we use cryptocurrencies as the target currency: btc.rate.sx; not implemented yet anyway);
  • for JPY and KRW, BTC price is displayed in scientific notation (1.31391e+6, 1.26863e+7) what is inconsistent.

Could you please test the new feature and give me some feedback?

@westonal
Copy link
Author

westonal commented Dec 5, 2017

For dollars (USD, AUD, CAD) you have '$' in front of the numbers in the headers (Market Cap: $351,742,820,072). You have to know, what $ is ment here (because you issue the query). I don't know, if it is correct. I suppose yes, in Canada and Australia the $ sign is used for local currencies, right?

Yes that's right, elsewhere it clearly says "CAD/AUD/USD", so it's obvious which $ it's refering to.

not really critical, because these currencies are not really volatile

Well, they can shift by a 1 or 2% some days, especially GBP with Brexit!

You might find this service useful to get % change in other currencies: https://apiv2.bitcoinaverage.com/#ticker-data-all

But looking good! Thanks!

@chubin
Copy link
Owner

chubin commented May 16, 2018

Done

@chubin chubin closed this as completed May 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants