hi all.
i am facing am problem where i have to tokenize the float value.
example suppose float value is 0.5 i want store this into array where
array[0] should contain 0 and array[1] should contain 5 .
please can anybody help me immediately.
Here is the java svc to convert float to string:
IDataCursor cursor = pipeline.getCursor();
Object i = IDataUtil.get(cursor,“iVal”);
String s = String.valueOf(i);
IDataUtil.put(cursor,“siVal”,s);
cursor.destroy();
and then after getting the string version of the float, use tokenize svc and the delimiter as “.”
If you want to be safe, there’s one step missing. That is, you’ll get in trouble if you want to tokenize a value like “.24” or “1” Proper thing to do then, would be:
Convert to String
pub.string:numberFormat (to change to 0.00000 format)
pub.string:tokenize
And if we want to be really picky… There are some locales which use comma as the decimal point.