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

number_to_words, group==2 and 3 digit numbers #217

Open
FredSRichardson opened this issue Jul 3, 2024 · 3 comments
Open

number_to_words, group==2 and 3 digit numbers #217

FredSRichardson opened this issue Jul 3, 2024 · 3 comments
Assignees

Comments

@FredSRichardson
Copy link

The current behavior for three digit numbers with group==2 is to split between the first two and last number. For example:

>>> p.number_to_words('123', group=2)
'twelve, three'
>>>

It is more common - at least in American English - to split after the first digit which would return 'one twenty-three'.

I realize a group is an arbitrary split, but I'm not sure the current behavior - at least for 3 digit numbers - reflects any common usage.

I realize there are a few other slightly inconvenient was to accomplish the same thing:

>>> ' '.join([p.number_to_words('1'), p.number_to_words('23')])
'one twenty-three'
>>> p.number_to_words('123').replace('hundred and ', '')
'one twenty-three'
>>>
@jaraco
Copy link
Owner

jaraco commented Sep 7, 2024

I tend to agree; I'd expect numbers to be grouped from least significant to most, then read from most to least.

Would you be interested in working on a PR to effect the change?

@NFeruch
Copy link

NFeruch commented Sep 9, 2024

@jaraco I'm interesting in contributing but there's no contributing.md file so I don't know how to setup my local environment correctly or run unit tests. How should I proceed?

@jaraco
Copy link
Owner

jaraco commented Sep 11, 2024

@NFeruch This project is hosted under the skeleton philosophy. There's some contributing guidance there. I have plans to make that guidance more visible and complete, but it should get you started. tl;dr - install tox somewhere and run it.

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

3 participants