cancel
Showing results for 
Search instead for 
Did you mean: 

How to do Right Justified in the mappin

Former Member
0 Kudos

Hi friends,

Can you help me to do the right justified for example 39.56- this should right side not from left. this field length is 11. infront of this 39.56 should be blank spaceses paded. how to do this

please help me

Thanks

ramidi

Accepted Solutions (1)

Accepted Solutions (1)

justin_santhanam
Active Contributor
0 Kudos

Ramidi,

Create simple UDF. Let say my input parameter name is "abc" . Write the below code in it

StringBuffer pad= new StringBuffer();

String ret_string="";

int add=0;

int trunc=0;

if(abc.length()<=11)

{

add =11-abc.length();

}

if(abc.length()>11)

{

ret_string =abc.substring(0,11);

}

else

{

for(int i=0;i<add;i++)

{

pad.append(" ");

}

ret_string = pad.toString()""abc;

}

return""ret_string"";

Hope it helps!!!

Best regards,

raj.

Former Member
0 Kudos

Hi Raj,

Thank you

Ramidi S

agasthuri_doss
Active Contributor
0 Kudos

Hi,

Select Value button.

Regards

Agasthuri Doss

agasthuri_doss
Active Contributor
0 Kudos

Hi,

No need to Import any Java Class

Regards

Agasthuri Doss

Former Member
0 Kudos

Thank you Raj, Agasthuri.

It's working

Regards

Ramidi

Answers (0)