X=98.20 ? transform(X, "@RL 99999.99")
Dave
-----Original Message----- From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Gene Wirchenko Sent: 12 September 2016 20:40 To: ProFox Email List profox@leafe.com Subject: Leading Zeroes
Hello:
On Foxite, Shaheryar Rashed started a thread "slow save at network". While I had nothing to add in general, I did note some awkward code: mvoucher = Right('0000' + Alltrim(Str(Thisform.voucherno1.Value)),5)
How do you do leading zeroes cleanly? This is a thing that has bothered me. One would think it would make an excellent option for transform(). There is @L but transform(123,"@L") generates "0000000123.00" which is not anything that anyone is likely to want. Usually, I want leading zeroes on integers.
transform() is not the answer; padl() is. Suppose you have 123 and want "00123". padl(123,5,"0") does it. Since the VFP documentation does not specify how the first expression is stringised, you might prefer padl(transform(123),5,"0")
Sincerely,
Gene Wirchenko
[excessive quoting removed by server]