Open MonikaMahanthappa opened 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"]
%w(a b 1 3 1.3).natural_sort
["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"]
["a", "b", "1", "3", "1.3", "a 1 b 10", "a 1 b 2"]
["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.
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.