Subject Re: String question
From Heinz Kesting <Nobody@Nowhere.com>
Date Sun, 12 Nov 2023 15:46:08 +0100
Newsgroups dbase.getting-started

Hi Charlie,
> Say you have a string such as a = "1000"
> I am using numbers in string form for a specific reason.
>
> I would like to add a comma like this...  "1,000"
>
> The data is in a form grid.  I was thinking I could use the function or picture properties of the column to do this but haven't been able to figure that out.  Is that possible or is there some other way to do this?

You could use the transform() function with picture symbols. As you work
in a grid, you probably have to use the beforeGetValue event of the
rowset's field.

Here's a first example to play with in the IDE, outside the grid and
form. Once you have it working for your needs here, you can start to
implement it into the the grid ...

c = "1000"
? transform(val(c), "@R 999,999")

returns for me
    1.000

The inserted delimiter depends on your setting for the numeric
separator, for me the German format and setting would display like
1.000.000

for the numeric value One Million.

Please read the help for the picture and funtion, transform() and
eventually beforeGetValue() for more information and examples.

Hope this helps,
Kind reagrds, Heinz