johnnyshields / naturalsort

NaturalSort is a simple library which implements a natural, human-friendly alphanumeric sort in Ruby.
MIT License
8 stars 4 forks source link

The sorting does not take care of periods/decimal points #6

Open MonikaMahanthappa opened 8 years ago

MonikaMahanthappa commented 8 years ago

Not working in case of %w(a b 1 3 1.3).natural_sort results in ["1.3", "1", "3", "a", "b"]

But it is working for ["a", "b", "1", "3", "1.3", "a 1 b 10", "a 1 b 2"] . This input results in ["1", "1.3", "3", "a", "a 1 b 2", "a 1 b 10", "b"]

Would like to know if there is a way to archive natural sorting for decimal numbers or is it an issue.