cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping issue

Former Member
0 Kudos

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..

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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,

Answers (2)

Answers (2)

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

to Use the standard function FormatNum: 000000.00

mapping:

input->formatNum->output.

i hope it will work.

regards,

ganesh.