-
Notifications
You must be signed in to change notification settings - Fork 55
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
Get Currency Display Name of Currency Code #72
Comments
Hey @deerawan. Yes, this is possible. Unfortunately I just noticed the currency data API isn't documented at all in the README. I'll see what I can do to change that. In the meantime, you can retrieve currency information this way: var TwitterCldr = require('twitter_cldr/core.js');
var usd = TwitterCldr.Currencies.for_code('USD');
// returns { country: 'USD', cldr_symbol: '$', symbol: '$', currency: 'USD' } Now, that doesn't give you the display name as you requested because the var usd = TwitterCldr.Currencies.currencies['USD'];
// returns { currency: 'USD', name: 'US dollar', cldr_symbol: '$', symbol: '$', code_points: [36] } Notice the |
Hi @camertron Thank you for your response. I will try what you suggest to me. One more question, for the currency name. Does it support currency name in other languages? e.g. if english, it is US Dollar but for Spain it should be Dólar estadounidense. |
Hey @deerawan. Unfortunately the current currencies implementation does not support currencies in multiple languages (only English). It shouldn't be too difficult to support this however. Would you mind filing an issue? Also, see this pull request which should address exposing display names. |
is it possible if we can retrieve currency display name of a given currency code?
e.g.
USD => US Dollar
IDR => indonesia rupiah
The text was updated successfully, but these errors were encountered: