Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Replace more than one character at a time STRTRAN?
Message
From
04/05/2004 10:13:49
 
 
To
04/05/2004 10:06:37
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00900695
Message ID:
00900700
Views:
11
This message has been marked as a message which has helped to the initial question of the thread.
>I have a character value in a field:
>
>MVALUE = "$9,999.99"
>
>and I need to change it to numeric 9999.99 with no formatting
>
>I need to replace the "$" with '' and the commas with ''. I cannot get STRTRAN() to replace two values instead of just one at a time. Is it possible or is there another function that will do it? I need a one line statement to do the replacement. The user could have entered the value in any means:
>
>9,999.99
>9999.99
>$9999.99
>
>I can only have a one line statement IIF(... or something along those lines to convert a value before it is passed to another app. The app that receives the value needs it to be numeric only for correct formatting.
>
>TIA!!!
>Tracy

hi Tracy,

I'm afraid you'll end up with 2 strtran.

but chrtran will do
?chrtran(mvalue, '$,', '')
Gregory
Previous
Reply
Map
View

Click here to load this message in the networking platform