Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tip of the day - PadX() numbers, dates...
Message
 
To
29/11/1999 11:47:09
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00296393
Message ID:
00296402
Views:
17
>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
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform