Remove dollar sign and commas
-
- Posts: 14
- Joined: Tue Oct 10, 2017 12:44 pm
Remove dollar sign and commas
I have a text field that contains dollar amounts with a dollar sign and one or more commas. I want to use the val() of this field but I need to get rid of the junk first. ____What would be a function or functions I can use to strip out a dollar sign and all commas. Removing everything that is not 0 to 9 will also work____BTW, I^ve already tried substr(), stuff(), and at() but I can^t figure out how to get rid of more than the dollar sign and one comma this way.____
=> RE: Remove dollar sign and commas
You can use the calc expression____STRREP(STRREP(fieldname, "," ,""),"$" ,"")____to strip , and $ from a field where fieldname is the name of the field containing the , and $.____Here is info from the help file:__Syntax:____STRREP(C1,C2,C3,L) where C1 is the full character expression, C2 is the substring to be replaced, and C3 is the replacement substring. The optional logical expression L controls the case sensitivity of the function. When L is true, the function is case sensitive; when it is false, the function is case insensitive. When this argument is not provided, the function uses the case sensitivity setting in the RRW.SRT file ____Example:____To replace every occurrence of the text "LP" with "Liveware Publishing" in a character field named COMMENT, create a field with the following expression:___STRREP(COMMENT,"LP","Liveware Publishing")______Kathleen__R&R Support
-
- Posts: 14
- Joined: Tue Oct 10, 2017 12:44 pm
=> RE: Remove dollar sign and commas
Thanks. I don^t know how I missed that function, but I did. Thanks for the clear example.