Site Tools


numsort

# $EPIC: numsort.txt,v 1.2 2006/07/17 03:42:24 jnelson Exp $

Synopsis:

$numsort(<list>)

Technical:

This function sorts the word list <list> in ascending numerical order. The numbers in <list> must be integral values, not decimal numbers. Non-numeric words are sorted in ascii order between 0 and 1. Numbers embedded within words in <list> are properly recognized.

Returns:

the given list, sorted in numerical order

Examples:

$numsort(4 -6 34 -96 0)              returns "-96 -6 0 4 34"
$numsort(4 -6 34 -96 0 Erf blah)     returns "-96 -6 0 Erf blah 4 34"
$numsort(boox boo1 boo0 boo-4)       returns "boo-4 boo0 boox boo1"
numsort.txt · Last modified: 2006/07/17 03:42 by 127.0.0.1