on 07-26-2010 7:08 AM
Hi All,
Can you please provide me the UDF for the conversion from string to the number?
Thanks in advance
Hi Swetha,
i think you have posted same thread few days back,and we have provided solution i guess..?? it is not working out??
where you struck exactly.??
Regards,
Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raja,
Thanks for the reply.
I have written the following UDF with the argument as input but it is giving the error with the empty processing log
Input Variable = String input
input=input.replaceAll(" ","");
// checking for null or spaces,if found return 0
if ((input.length() == 0) || ( input == "") )
return ""+0;
else{
Integer x = new Integer(input);
return x.toString();
}
Can you please help me?
Thanks in advance.
Hi Swetha,
Please use the Function below to get the result :
//--- Utility function to get int using a dialog.
public static int getInt(String mess) {
int val;
while (true) { // loop until we get a valid int
String s = JOptionPane.showInputDialog(null, mess);
try {
val = Integer.parseInt(s);
break; // exit loop with valid int >>>>>>>>>>>>>>>>>>>>>>
}catch (NumberFormatException nx) {
JOptionPane.showMessageDialog(null, "Enter valid integer");
}
}
return val;
}//end getInt
I have not tested the function ,so just let me know if it is working or not.
Regards
Ravi Anand
answered
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 | |
10 | |
10 | |
10 | |
7 | |
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.