Skip to Content
0
Former Member
Jul 21, 2008 at 04:39 PM

add 0 at left

92 Views

hi guys,

i need to fill a field with left 0s.

example.

data: num(10).

data: len type p,

data: n type n.

num = '12345'. " and i want '0000012345'

describe field num into len.

n = 10 - len.

shift num right by n places.

do n times.

replace space with '0' into num

enddo.

this will work, my problem is that describe field always give 10, and i need exactly the number of positions filled.

any ideas?

tks in advance