I have a string of fourteen values seperated by #
0.1#5.338747#0.0#.... and so on
I want to convert each value from a string to a float or double to 3 decimal places. I can do most of this the long way...
str = "0.1#0.2#0.3#0.4";
String[] results;
results = str.split("#");
float res1 = new Float(results[0]);
but I'm not sure of the best way to get each float to 3 decimal places. I'd also prefer to do this in something neat like a for loop, but can't figure it out.