Page 1 of 1

Remove dollar sign and commas

Posted: Mon Oct 01, 2001 4:03 pm
by Andrew_Bokelman
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

Posted: Tue Oct 02, 2001 8:13 am
by kfleming
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

=> RE: Remove dollar sign and commas

Posted: Tue Oct 02, 2001 2:49 pm
by Andrew_Bokelman
Thanks. I don^t know how I missed that function, but I did. Thanks for the clear example.