on 07-26-2007 10:13 AM
Hello Gurus,
I need to have a function in XI simular to PadRight. Padright fills a string value up to an certain amount of chars, for example:
PadRight('12345','0','10') outcome is 0000012345
I think it is doable with standard XI functionality but I am not shure because you have 3 situaties
PadRight('','0','10') returns 0
PadRight('1123456789','0','10) returns 1123456789
PadRight('12345','0','10') return 1234500000
But can I build a structure with actually a case secanario
Case length = 0 then
Case length = 10 then
Case length < 10 then
Or do I need a UDF ?
Best regards,
Guido Koopmann
Use the standard function FormatNumber.
Regards,
Jai Shankar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try to make a UDF based on the logic below;
a sample code is;
String input = "1001";
int len = 10; //this is the maximum length that the field can take
StringBuffer sBuf= new StringBuffer(input);
while (sBuf.length() < len) {
sBuf.insert(0,'0');
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
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.