| Subject |
Re: convert a number like 1174.88 to a character field |
| From |
Ken Mayer <dbase@nospam.goldenstag.net> |
| Date |
Thu, 4 Dec 2025 05:13:45 -0800 |
| Newsgroups |
dbase.getting-started |
On 12/3/2025 7:02 PM, Ken Mayer wrote:
> On 12/3/2025 5:09 PM, ed furche wrote:
>> i get a character field that rounds off the cents i want to see
>> "1174.88" not "1175"
>> my code - store ltrim(rtrim(str(amt))) to stramt.
>
>
> str( 1174.88, 8 , 2, "9,999.99" )
>
> Look at this function in help. You're doing too much work here.
>
?ltrim(str( 1174.88, 8 , 2 ))
I know it's possible to use a picture (such as "9,999.99") in some
version of this, and I can never remember the function ... (there are
places the help could be more useful ... but oh well).
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
|
|