I need to handle a bunch of attributes, with different values inside, could be number or text. For number I need to format it and for text I just leave it as it is.
Currently I do it by search “.” in the values, but the problem is some of the values could be “aaaaaaa 5.0” or “bbb111.b”, this will cause exception in numberformat function.
So I am lost, is there any functions which can distinguish number and text?
Dear Sreedhar,
For the above code we are getting a strange output for any number which ends with ’ f ’ , its saying True .Does this takes as numeric/float in webMethods code ?
Eg: if we give input as 456f the output we are getting is True which should not be!
Yes, the f is considered a part of the floating point literal by Java. (Java is not “webMethods code.”) You’ll find that F, f, D, and d are also interpreted as part of the number. [URL=“Java SE Specifications”]Java SE Specifications
If you need to evaluate a string to detect non-numeric characters more restrictively, you can use a variety of techniques. A search of the web for “java isnumeric” will turn up some interesting information you may be able to leverage.