Skip to content

Instantly share code, notes, and snippets.

@Macagare
Created February 26, 2013 17:49
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 Macagare/5040487 to your computer and use it in GitHub Desktop.
Save Macagare/5040487 to your computer and use it in GitHub Desktop.
CF: convert list to numeric list
/**
* convert list to a list with numeric elements
*
* @param required string numList source list with elements]
* @return list with numeric items
*/
string function toNumericList( required string numList ) {
var numListLen = listLen( arguments.numList );
var result = "";
if ( numListLen > 0 ) {
for ( var i = 1; i <= numListLen; i = i + 1 ) {
if ( isNumeric( listGetAt( arguments.numList, i ) ) ) {
result = listAppend( result, listGetAt( arguments.numList, i ), "," );
}
}
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment