I am attempting to convert a float into a string.
I have a string (dividedstring[2]) that represents CPU load e.g. 0.00 or 0.01 or 0.54 etc.
I then would like to convert this into a float, so I do the following:
float.TryParse(dividedstring[2], out insertCPUvalue);
Now when I attempt to display the float e.g.:
MessageBox.Show(insertCPUvalue.ToString());
I get: “0”, now I am assuming this is because the string “dividedstring[2]” was == “0.00”, so it has just taken the decimal points of? – and rounded it to 0?
1 Answer