Subject Re: convert a number like 1174.88 to a character field
From Ken Mayer <dbase@nospam.goldenstag.net>
Date Sat, 6 Dec 2025 05:13:32 -0800
Newsgroups dbase.getting-started

On 12/5/2025 10:24 PM, Lee Grant wrote:
> Ken,
>
> That would be the function property of @R "@R 9,999.99" which will
> format the number with place holders that will appear in printout but
> not in the field (comma, and period (or decimal separator)) to allow the
> number to only appear like this, without rounding any said number,
> unless someone coded the conversion of a variable and then fed it to
> this, then the number would already be rounded up or down per that
> coding, not this format via Picture and Function formatting.

Yes, I was very tired at the time I tried this. And the picture doesn't
work here. I did try it again using the @R or @ symbols. The string at
the end inserts the first character as a leading character if needed,
and multiples if needed. So in my example:

? str( 1174.88, 8 , 2, "@R9,999.99" )

Produces:

@1174.88

It ignores everything else. That could be a * or anything, but it should
be a simple symbol. I know there is a function in dBASE that takes the
picture to convert a numeric value to a string, but I can never remember it.

Ken

--
*Ken Mayer*
Ken's dBASE Page: http://www.goldenstag.net/dbase
The dUFLP: http://www.goldenstag.net/dbase/index.htm#duflp
dBASE Books: http://www.goldenstag.net/dbase/Books/dBASEBooks.htm
dBASE Tutorial: http://www.goldenstag.net/dbase/Tutorial/00_Preface.htm
dBASE Web Tutorial: http://www.goldenstag.net/dbase/WebTutorial/00_Menu.htm
dBASE DOS to Windows Tutorial:
http://www.goldenstag.net/dbase/DtoWTutorial/00_Menu.htm