Skip to content

Instantly share code, notes, and snippets.

@emileswarts
Created September 17, 2013 10:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emileswarts/6592488 to your computer and use it in GitHub Desktop.
Save emileswarts/6592488 to your computer and use it in GitHub Desktop.
ruby float string sort
irb(main):001:0> ar = ["6", "7", "9", "11.5", "6", "8.5"]
=> ["6", "7", "9", "11.5", "6", "8.5"]
irb(main):002:0> ar.sort!
=> ["11.5", "6", "6", "7", "8.5", "9"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment