Created
April 5, 2017 19:04
-
-
Save anonymous/f103f7d0c1241bdb92b3838d495be1ea 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> | |
source1 = '2 000,99'; | |
source2 = '2,000,99'; | |
// remove ALL commas and spaces | |
example1 = REReplace(source1,"[\s,]","","all"); | |
example2 = REReplace(source2,"[\s,]","","all"); | |
// insert a decimal before the last two digits | |
example1 = Insert(".",example1,(Len(example1)-2)); | |
example2 = Insert(".",example2,(Len(example2)-2)); | |
writeOutput(source1 & " = " & example1); | |
writeOutput("<br>"); | |
writeOutput(source2 & " = " & example2); | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment