Hi eveyone,
I need some help regarding appending the leading zero's infront for negative values
My source file is a simple text file , which has a column QT of integer type of length 6.
The input data for QT is like
888
-3456
12
-22
And i have to map column QT to QTY with leading zeros and the target column QTY of varchar type of length 6
My desired ouput should be like
000888
-03456
000012
-00022
I used the following function in the transformer :::
Right("000000" : InLink.QT, 6)But iam getting output as
000888
0-3456
000012
000-22
Can anyone suggest the solution for this one.
Your help is greatly appreciated.
Thanks in advance,
dodda
Leading zero's infront for negative values
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Code: Select all
If Left(Col1,1) = "-" Then "-" : Right("000000" : Right(Col1,Len(Col1)-1)) Else Right("000000" : Col1)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.