From: konstantin.mailinglists@... Date: 2008-05-19T04:20:05+09:00 Subject: Re: Array.sort with bignum fails? On 18 Mai, 20:37, Rg Rg wrote: > I have a array with big numbers and sort method does not order it > correctly. > > irb(main):017:0> a = [ "8412478247689", "25977", "88582", > "8410347003107" ] > => ["8412478247689", "25977", "88582", "8410347003107"] > irb(main):018:0> a.sort > => ["25977", "8410347003107", "8412478247689", "88582"] > irb(main):019:0> > > Exists some other form to order the Array? > -- > Posted viahttp://www.ruby-forum.com/. Try using Integers instead of Strings; >> a = [8412478247689, 25977, 88582, 8410347003107] => [8412478247689, 25977, 88582, 8410347003107] >> a.sort => [25977, 88582, 8410347003107, 8412478247689]