cancel
Showing results for 
Search instead for 
Did you mean: 

Message Mapping, filling field with 0 (zeros) on left

Former Member
0 Kudos

I need to fill a field with values that has variable lenght adding 0 (zeros) on the left, how can I do it ?

I'm using the LENGHT in message mapping, with value returned by LENGHT I use FIXVALUES to map the quantity of 0 (zeros) that I need to add in the field.

Somebody can help me with this problem ?

Thank's.

Accepted Solutions (1)

Accepted Solutions (1)

STALANKI
Active Contributor
0 Kudos

do u want to use a built in function?

instead write a simple user defined function with 1.

parameter and source code looks like this.

for(i=a.length;i<(ACTUAL LENGTH(XSD));I++)

a=a+"0".

return a;

that will solve ur problem and u can allot..me 10..:)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Regis,

You can use the Arithmetic:FormatNum built-in function for this.

If you want to left-pad the number with zeros so that the length is always 10, then specify 10 zeros for the format, 0000000000.

This function takes formats based on java.text.DecimalFormat so you can see all of the possibilities at:

java.sun.com/j2se/1.4.2/docs/api/java/text/DecimalFormat.html

Thanks,

Jesse