Created
April 24, 2024 09:01
-
-
Save trycf/dded317d7f994003109347b44f47371d to your computer and use it in GitHub Desktop.
TryCF Gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
num1 = "1.234.567,90"; | |
rNum = reverse(num1); | |
for(i=1; i<len(rnum); i++){ | |
if(!isNumeric(rNum[i])){ | |
decimalSeparator = rNum[i]; | |
break; | |
} | |
} | |
for(i=1; i<len(num); i++){ | |
if(!isNumeric(num[i]) && num[i] != decimalSeparator){ | |
num = replace(num, num[i], ""); | |
} | |
} | |
dump(num); | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment