Hi,
How to pad zero's to the left of an integer?
I have 2 inputs Id1(Integer 21) and Id2(Integer 4)
I want the output as Id3(Integer 25)
Logic for Id3 : Concat Id1 and Id2
If Id2 = 24, my output should be Id1:0024
If Id2 = 235, my output should be Id1:0235
Please provide a approach for this.
Padding Zero's to the left of an integer
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 9
- Joined: Thu Nov 29, 2007 10:45 pm
Re: Padding Zero's to the left of an integer
Trysuchit1983 wrote:Hi,
How to pad zero's to the left of an integer?
I have 2 inputs Id1(Integer 21) and Id2(Integer 4)
I want the output as Id3(Integer 25)
Logic for Id3 : Concat Id1 and Id2
If Id2 = 24, my output should be Id1:0024
If Id2 = 235, my output should be Id1:0235
Please provide a approach for this.
Str function. follow the syntax.
Str('0',(4-Len(Id2)):Id2)
Re: Padding Zero's to the left of an integer
Trysuchit1983 wrote:Hi,
How to pad zero's to the left of an integer?
I have 2 inputs Id1(Integer 21) and Id2(Integer 4)
I want the output as Id3(Integer 25)
Logic for Id3 : Concat Id1 and Id2
If Id2 = 24, my output should be Id1:0024
If Id2 = 235, my output should be Id1:0235
Please provide a approach for this.
Str function. follow the syntax.
Str('0',(4-Len(Id2)):Id2)