cancel
Showing results for 
Search instead for 
Did you mean: 

FormatNum with strings

Former Member
0 Kudos

Hi

did any1 used User Defined Function to format string ?

I get supplier code with 4 or 5 chars and I need to convert it in mapping

to a 15 length field which the other chars will be spaces

thx,shai

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

thx

it was v.helpfull

Former Member
0 Kudos

Shai,

Create a <b><i>Value</i></b> UDF with one input parameter <b><i>String</i></b> and name the UDF as <i><b>PadString</b></i>.

Then add this code:

import java.*;

while (String.length()<Integer.parseInt("15"))

{

String = String + " " ;

}

return String;

It will give you the result what you have expected.

---Satish