From: Josselin Date: 2006-12-19T07:05:07+09:00 Subject: Re: sorting an array w multiple values On 2006-12-18 17:55:53 +0100, "Gavin Kistner" said: > From: dblack@rubypal.com [mailto:dblack@rubypal.com] On >> On Tue, 19 Dec 2006, Josselin wrote: >> >>> I understand how to sort an array with a single value but >> how can I sort an >>> array w multiple values : [ integer_value1, float_value2] >> >> sorted_array = an_array.sort_by {|e| e[1] } > > And if you want to sort by multiple values, in your own chosen order: > > sorted_array = an_array.sort_by{ |e| [ e[1], e[0] ] } thanks got it too... I think I am strating to understand the logic behind Ruby structure... so now I'll know where to look for before asking .. ;-)) ... but asking and getting answers help others too....