ec2instances.info icon indicating copy to clipboard operation
ec2instances.info copied to clipboard

Sorting with "alphanum" would be nice

Open pwinston opened this issue 5 years ago • 4 comments

Sort order is alphabetical. It would work much better with "alphanum" sorting: http://www.davekoelle.com/alphanum.html

The alphabetic order today is: (see image below) r5.12xlarge r5.16xlarge r5.24xlarge r5.2xlarge r5.4xlarge r5.8xlarge

The alphanum order would be: r5.2xlarge r5.4xlarge r5.8xlarge r5.12xlarge r5.16xlarge r5.24xlarge

Screen Shot 2019-10-10 at 8 35 57 PM (2)

pwinston avatar Oct 11 '19 00:10 pwinston

@pwinston I'd love to see a PR for this, please consider contributing it.

cristim avatar Oct 11 '19 10:10 cristim

That's probably better known as natural sorting, there's a plugin for that: https://datatables.net/plug-ins/sorting/natural

But it would be even better if it could be sorted by unit size so nano is before small is before 2xl.

blckct avatar Oct 11 '19 13:10 blckct

I usually sort by price to achieve this order

cristim avatar Oct 11 '19 15:10 cristim

@cristim That works pretty well once I realized you can filter for r5\. with the dot escaped to give you all r5 instances (without r5a, r5d, r5ad). If you just filter for r5. that doesn't work, have to escape the dot.

Those two tricks together seem like a very solid workaround. Thanks!

pwinston avatar Oct 11 '19 22:10 pwinston