on 04-27-2009 3:48 PM
Hey,
can anyone tell me what is the java function for add leading zero's in xi mapping.
TX
Hi Zevik,
As other threads mentioned used FormatNum and double click and put Zeros. Like if the lenght is 10 then put 10 zeros. Here one thing you should analyse is, if your input value has a string value it will fail in FormatNum becuase it expects only the numeric value.
So if you dont know whether your input has numeric or alphanumeric then go to UDF. So create a udf with name AddZeros and as Value with one argument as input.
Imports: java.*;
Then add this code:
int len=input.length();
for(int i=0; i<10-len;i++)
{
input="0"+input;
}
return input;
Here I am assuming the total length is 10. If yours is 20 then put 20 instead of 10 in the second line of the code.
Regards,
---Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
>> input---> formatNumber[0000000000]--
>output
it is function in Arthematic (format number). there i am giving 10 '0' s. if it is less than 10 digits it will automatically add zero's on left side.
if input is 12345 output will be 0000012345
Thanks.
Madhav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you could use the standard Arithmetic function FormatNum.
Regards
Patrick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
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.