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

Allow specific currencies #1

Open
SlexAxton opened this issue Dec 16, 2015 · 2 comments
Open

Allow specific currencies #1

SlexAxton opened this issue Dec 16, 2015 · 2 comments

Comments

@SlexAxton
Copy link

https://github.com/format-message/message-format-rb/blob/master/lib/message_format/interpreter.rb#L91

Currently, using a message like Your total is: {amount, number, currency} can only support USD (Since that's the default in Twitter's CLDR lib[0]).

I'm unsure of the best way to add this functionality (I'm no ruby pro), but it'd be quite helpful.

Until then, it's decently easy to just pass in a Twitter CLDR formatted currency as a string, but it'd be cool to do all in one spot!

Thanks!

[0] https://github.com/twitter/twitter-cldr-rb/blob/4054e3ee23c42716d14c38231c7b39169a3afad4/lib/twitter_cldr/formatters/numbers/currency_formatter.rb#L11

@vanwagonet
Copy link
Contributor

I'm no ruby pro either. :) I added custom formats to the related JavaScript library a while back, so I can certainly take a look at making them work here as well.

I've got a bunch of competing priorities right now, though, so if you'd like to try to implement it in a pull request, you can probably get it sooner.

@SlexAxton
Copy link
Author

I'll see what I can do. I think I'd classify this as a bug, since trying to format EUR or CAD currencies through the currency number helper will output incorrect values, but it probably doesn't matter what the label is.

jagn3w referenced this issue in figma/message-format-rb-public Mar 2, 2022
Update bundler version and add lockfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants