I know I'm supposed to use transform(nVar, "@L 99") to turn 1 into "01"
instead of padl(nVar, 2, '0') .... but I just ran into "1." and I don't
remember what setting causes the padl() idea to fail.
Please remind me.

Re: padl() gaff refresher needed by Sergey

Sergey
Wed Jun 18 16:56:33 CDT 2008

Lew wrote:
> I know I'm supposed to use transform(nVar, "@L 99") to turn 1 into "01"
> instead of padl(nVar, 2, '0') .... but I just ran into "1." and I don't
> remember what setting causes the padl() idea to fail.
> Please remind me.

Make sure that value is an integer

padl(INT(nVar), 2, '0')

--
--sb--

VFP MVP

Re: padl() gaff refresher needed by Zootal

Zootal
Wed Jun 18 18:47:59 CDT 2008

transform( val( transform(nVar)), "@L 99" )

If nVar = "1.", then it isn't numeric. The transform(nVar) function converts
both "1." and 1 into a char, and the val converts it back to numeric. This
way it works whether nVar is char or numeric. The val function will throw
out the decimal sign, and give you 1, which you finally feed into the outer
transform function, giving you "01".


"Lew" <Lew@discussions.microsoft.com> wrote in message
news:E90B5D1E-924D-4FCA-80B9-EC6A498E241F@microsoft.com...
>I know I'm supposed to use transform(nVar, "@L 99") to turn 1 into "01"
> instead of padl(nVar, 2, '0') .... but I just ran into "1." and I don't
> remember what setting causes the padl() idea to fail.
> Please remind me.