Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Tip of the day - PadX() numbers, dates...
Message
De
30/11/1999 06:37:07
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00296393
Message ID:
00296761
Vues:
21
>>This is already in the FAQ for two days now, but Nick told me to post it here:
>>
>>As described in the help, padr('abc',20) will give a string with 17 trailing blanks - but try padc(12, 13), or padl(date(), 20) - you will get a string containing the string representation of number 12 or today's date, padded with blanks (or any other string you choose) on the side of your choice.
>>
>>Try padc(datetime(), 80, '-*- ') and see what you get.
>
>Yeah, I think it is an excellent tip, and also wanted to add
>that, for example, PADL(12.4590, 12) gives you " 12.4590",
>so ALLTRIM(PADL(12.4590, 12)) could be used instead of STR() and this way there is no need in counting the length of field/variable with decimal point and number of decimal points (like in STR(12.4590, 7, 4). And instead of 12 you may put any number which is for sure bigger than the lenght of the your field/variable. Just another way of doing things...
>
>Nick

Excellent!!

The number of times I've had work out the number of decimal places to use str(x,y,z).

This will definately save me a lot of time/effort in the future ;-)

Jason
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform