Tuesday, June 10, 2014

Sorting a List of Numbers

let numbers = [7, 9, 18, 12, 22]
echo sort(numbers)

[12, 18, 22, 7, 9]


What's going on here? Is there some way by which I can sort these as Numbers and not Strings?

Thanks!

Ben

--
b

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: