in reply to Re: Sorting an array of hashes with an exeption
in thread Sorting an array of hashes with an exception

Hi again, it does not change the output though? I'm still getting this as the result:

ID: 5 Distance: 2.1 RouteDistance: 0
ID: 1 Distance: 1.7 RouteDistance: 2.5
ID: 2 Distance: 1.5 RouteDistance: 2.8
ID: 3 Distance: 2.3 RouteDistance: 4.3

  • Comment on Re^2: Sorting an array of hashes with an exeption

Replies are listed 'Best First'.
Re^3: Sorting an array of hashes with an exeption
by choroba (Cardinal) on May 09, 2013 at 21:24 UTC
    Sure. 2.1 < 2.5, therefore 5 gets first. Try setting Distance of 5 to 3.1.
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

      I don't know how this solution can be at any help.

      Instead of changing distance I might aswell just change the RouteDistance to a bigger number and hope for the best..

        I probably still do not understand how you want the results sorted. Can you give a more detailed description?
        لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ