Discussion:
add "," to sting
(too old to reply)
Alonso Vilela
2007-02-14 22:39:21 UTC
Permalink
Hi I have some fields of the table in this format $1,587.00 and I need do
conversion and the result suppose show as : 2,584. the original data coming
in character and the result too...
RGBean
2007-02-14 23:54:15 UTC
Permalink
Alonso,
You could do this with a single command - you may need to adjust some of the
parameters to get your exact requirements.

field = "$1,234.00"
?TRANSFORM(VAL(CHRTRAN(field,"$,","")), "999,999")

1) ChrTran() kills off the $ and ,
2) Val() changes it back to a numeric value
3) Transform() puts the result back into a string format

Rick
Post by Alonso Vilela
Hi I have some fields of the table in this format $1,587.00 and I need do
conversion and the result suppose show as : 2,584. the original data
coming in character and the result too...
Alonso Vilela
2007-02-15 16:08:34 UTC
Permalink
ok.
I test transform function.
Another question ?
Do you know how get the field of the table into the controlist or option
group or checkbox to do easy and exact, because sometimes are more one
field..

Thanks
Post by RGBean
Alonso,
You could do this with a single command - you may need to adjust some of
the parameters to get your exact requirements.
field = "$1,234.00"
?TRANSFORM(VAL(CHRTRAN(field,"$,","")), "999,999")
1) ChrTran() kills off the $ and ,
2) Val() changes it back to a numeric value
3) Transform() puts the result back into a string format
Rick
Post by Alonso Vilela
Hi I have some fields of the table in this format $1,587.00 and I need do
conversion and the result suppose show as : 2,584. the original data
coming in character and the result too...
Stefan Wuebbe
2007-02-16 10:24:16 UTC
Permalink
Post by Alonso Vilela
ok.
I test transform function.
Another question ?
Do you know how get the field of the table into the controlist or option
group or checkbox to do easy and exact, because sometimes are more one
field..
See AFields() in help.


hth
-Stefan
--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------
Loading...