Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
COUNTING CHARACTERS IN A VARIABLE
Message
From
11/01/2001 02:33:08
Gavin Reid
L & M Marketing Pty Ltd
Frenchs Forest, Australia
 
 
To
11/01/2001 01:27:10
Garry Sankowsky
Zodiac Publications
Tolga, Australia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00462068
Message ID:
00462085
Views:
13
Hi Garry,

Sorry, I should have given you a better example than the previous one:
PROCEDURE ConvertDollarsAndCentsToZeroFilledString

LPARAMETERS nDollarsAndCents

LOCAL nEFTTotal, cEFTTotal

nEFTTotal = nDollarsAndCents * 100

cEFTTotal = PADL(ALLTRIM(STR(nEFTTotal)),10,"0")

RETURN cEFTTotal
Hope this Helps,
Gavin...

>I am trying to create an ascii file to send direct payments to a bank. One of my problems is that some fields have to be
>filled with leading zeros. If I place an amount in a variable like this -
>First I multiply the amount by 100 to convert it to cents,
>then place it in a variable - store left(str(amount), 10) to efttotal
>
>I then need to know how many zeros to place in front as the field has to be filled with leading zeros.
>
>156.55 should end up looking like 0000015655
>
>Can anyone help?
Previous
Reply
Map
View

Click here to load this message in the networking platform