on 08-21-2015 12:37 PM
Hi Expert,
Currently I am using formatNumber standard function to create 18 digits number, but its failing when alpha numeric comes as input. now Can you please some udf to handle alphanumeric input and required to 18 digits output. if input length less than 18 digits, then zeros should be padded. Please suggest if it is possible thru graphical.
Please provide the udf earliest. thanks in advance.
Thanks,
chandar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
could you please provide sample input value and expected output
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chandra,
Try with the below udf:
if(input[0].length()>=18)
result.addValue(input[0]);
else if(input[0].matches("[0-9]+"))
{
String res="";
for(int i=0;i<(18-input[0].length());i++)
res=res+"0";
res = res + input[0];
result.addValue(res);
}
else
result.addValue(input[0]);
If the input is a alphanumberic, then we are not padding any zeroes as the prefix.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.