on 12-05-2011 10:26 AM
In mapping How to add Zeros on left side for target field? I mean data coming 12 from source system and itu2019s convert to 0000000012 for target.
Ex: 0000000012
And same as How to add Zeros on right side for target field?
Ex: 1200000000
thanks
roopa..
hi roopa 143,
In mapping How to add Zeros on left side for target field? I mean data coming 12 from source system and itu2019s convert to 0000000012 for target
First one is possible with standard function u201CformatNumber u201C of Arithmetic function group
Source field -> formatNumber ->Target Field
Click on formatNumber give number format based on your requirement and remove decimal separator.
And same as How to add Zeros on right side for target field?
Might be second one is possible with Simple UDF.
String AddZeroOnLeft(String Val, Container container) throws StreamTransformationException{
String temp = "";
if (Val.length() < number){
for(int i=0; i<number; i++ )
{
temp = Val+"0";
Val = temp;
}}
return (Val);
}
thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, to add Zeros on the right side, you could e.g. use the Concat function. As the second input parameter you have to provide the zeros you want to add. If it is a constant number of zeros, use the Constant function. You can also dynamically generate the zeros if necessary.
Regards, Martin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
to Use the standard function FormatNum: 000000.00
mapping:
input->formatNum->output.
i hope it will work.
regards,
ganesh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.