-
Notifications
You must be signed in to change notification settings - Fork 52
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
Add thousands separator support when LOCALE is enabled. #36
Comments
Natsort currently does not support thousands separators. It does understand the difference in the decimal point, but that's not the issue here. The problem is that it is unclear in general if something is supposed to be a thousands separator or not. For example, if a user provides "14,57 x,y" they would not want it treated as the thousands separator. I would be in support of adding a flag to enable this, but not turning it on by default as I would be afraid it would break other people's code. |
That makes sense. I will take a look. |
I am in the middle of refactoring natsort to make it easier to add new features. I will add this functionality after I have completed the refactor. |
LOCALENUM is also now dependent on FLOAT. Additionally, it was found that the broken locale problem extends to the thousands separator character. A lookup table has been implemented for locales with known problems. This closes issue #36.
OK, version 5.0.0 is released and this functionality is now part of the Feel free to add |
Thanks. I certainly will. This library deserves to have good publicity. |
Thanks, I appreciate that. |
This issue was discovered when I tried to suggest
natsort
as the way to go for this Stack Overflow question: http://stackoverflow.com/q/36431810/2988730I was trying to do the following based on the docs:
or alternatively
The result in both cases is
The result that the OP (correctly) expected is
It appears that natsort is not picking up the locale correctly?
I am using Red Hat Enterprise Linux Release 6.5 (64 bit) with anaconda.
natsort 4.0.3
is running underPython 3.5
.Also, just to check that the locale is being set, I ran
locale.localeconv
afterlocale.setlocale(locale.LC_ALL, 'german')
:The text was updated successfully, but these errors were encountered: