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

Comparison of negative numbers fails #15

Closed
vanboom opened this issue Oct 3, 2024 · 1 comment
Closed

Comparison of negative numbers fails #15

vanboom opened this issue Oct 3, 2024 · 1 comment
Labels

Comments

@vanboom
Copy link

vanboom commented Oct 3, 2024

Reference: javve/list.js#562 (comment)

@nwoltman
Copy link
Owner

nwoltman commented Oct 4, 2024

Hi @vanboom. I've addressed this issue before here: #1 (comment)

Treating numbers with a - sign before them as negative numbers is generally not a feature of natural sorting algorithms and I have no plans to include handling for negative numbers in this module (same goes for numbers with decimals). Implementing those features would require introducing heuristics which would work for some people, but break sorting for other people.

My recommendation is to handle sorting strings that are pure numbers separately, and then pass other strings to string-natural-compare.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants