Skip to content

[STS] Natural sort (compare numbers) feature #29

@jyukumite

Description

@jyukumite

Long time simple tab sorter user - awesome tool, thanks

Request: sts could sort tabs with numbers in order.

If I have a bunch of github tickets open, like...

https://github.com/pwhite2/simple-tab-sorter/issues/19 #19

https://github.com/pwhite2/simple-tab-sorter/issues/2 #2

...then these get sorted in string order (19 < 2) instead of numeric order (2 < 19)

Possibly fixed with numeric option:

const arr = ["hello100hello", "hello12hello", "hello2hello", "hello1hello"];
arr.sort((a, b) => a.localeCompare(b, undefined, { numeric: true }));
console.log(arr);
// ["hello1hello", "hello2hello", "hello12hello", "hello100hello"]

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions