Skip to content

seancoyne/naturalsort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Natural Sorting Algorithm for ColdFusion

This CFC will allow you to perform a natural sort on a ColdFusion array.

It was based on the Javascript implementation by Kristof Coomans.

This utility uses QuickSort by James Sleeman to perform the actual sort.

Example Usage:

a = ["test11", "test1", "test2"];
sorter = new naturalsort();
sortedArray = sorter.sort(a);

This will result in an array in natural order, "test1", "test2", "test11" instead of "test1", "test11", "test2" as would happen with "arraySort()".

Tested on ColdFusion 9, 10 and Railo 4.0.4

To run the unit tests simply edit the Application.cfc and update the path to mxunit to match your system then run http://path/to/naturalsort/naturalsortTest.cfc?method=runTestRemote

Pull requests welcome, be sure the unit tests pass and add any new unit tests as neccessary.

About

A natural sort algorithm implementation in ColdFusion

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published