Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Formating data results
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00470068
Message ID:
00470188
Views:
33
>I have come across an old program or two that has the very old commands in them that format the result of say sum(number) as newnum and they actually tell the command to allow 7 numbers on the left side of the decimal and 3 on the right side of the number. I don't know what this is called so I can't find it in the help. Today I used CMONTH(settdate) to get the month of the date. It gave me the months with just the first 4 letters. Is this normal? Can I change this to show the whole name?
>
>Thanks in advance for your help
>
>Randall

Luis' answer will work for the month problem. The reason you probably got only 4 characters is it sounds like you're using a select statement and the first matching record was June or July, so it made the field only 4 wide.

To format the number as a string, you can use:
cValue = STR(nValue,11,3)
or
cValue = TRANSFORM(nValue,"#######.###")
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform