Skip to content

Instantly share code, notes, and snippets.

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 trycf/0ea3b738e0fa1d5918e09f78aec1154f to your computer and use it in GitHub Desktop.
Save trycf/0ea3b738e0fa1d5918e09f78aec1154f to your computer and use it in GitHub Desktop.
TryCF Gist
<cfscript>
//num = "1,234,567.89";
//num = "1.234.567,89";
//num = "1’234’567.89";
//num = "1 234 576.89";
//num = "1234567.89";
if(num[len(num) - 2] == ",") {
num = replace(num, ".", "", "all");
num = replace(num, ",", ".", "all");
} else {
num = reReplace(num, "[^\d\.]", "", "all");
}
dump(num);
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment