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: currency mode #213

Open
m-aciek opened this issue Jun 20, 2024 · 3 comments
Open

Feature: currency mode #213

m-aciek opened this issue Jun 20, 2024 · 3 comments

Comments

@m-aciek
Copy link

m-aciek commented Jun 20, 2024

Hello @jaraco, would you accept a currency mode as an contribution, in scope for this library?

Possible API:

>>> from inflect import engine
>>> engine().number_to_words(100_020.56, decimal="and", decimal_format="currency")
'one hundred thousand and twenty and 56/100'
@jaraco
Copy link
Owner

jaraco commented Jun 20, 2024

That seems reasonable and perfectly in scope.

Could you write a short description of what benefit this feature would add (where would you use the feature)? Does this feature apply only to US currency or is this syntax used in other currencies?

The proposed API seems suitable, if a bit roundabout. Thinking about the user's ergonomics, should we consider a separate method (e.g. number_to_currency)?

@m-aciek
Copy link
Author

m-aciek commented Jun 20, 2024

Could you write a short description of what benefit this feature would add (where would you use the feature)?

I would use it in documents that need that format as an output for currency.

Does this feature apply only to US currency or is this syntax used in other currencies?

I'm not familiar with the standards in many countries. I know that such format is used in US, Canada and in Poland (in documents and for postal money orders).

The proposed API seems suitable, if a bit roundabout. Thinking about the user's ergonomics, should we consider a separate method (e.g. number_to_currency)?

I don't have a strong opinion on it. Separate method could be ergonomic indeed. cc @szymon-borkowski ?

@jaraco
Copy link
Owner

jaraco commented Jun 20, 2024

Sounds good. Feel free to proceed with a PR.

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