on 06-12-2015 3:42 AM
Hi Experts,
can you help with UDF code for below logic.
-->Need to check whether input field is numeric or not, if so need to check whether length of the field is 9 or not, if so need to append '-' between 5th and 6th digit.
Thanks for your help in advance.
HI Mohan,
Here you go:
UDF Type: single values
arguments: inp (String)
if(inp.matches("[-+]?\\d*\\.?\\d+")){
if(inp.length()==9){
return inp.substring(0,5)+"-"+inp.substring(5);
}
else{
return inp;
}
}
else{
return "not numeric";
}
Regards,
Mark
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 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.