Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Formating data results
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00470068
Message ID:
00470188
Vues:
29
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform