"How to convert a float to a string with exactly one decimal"
This question has been asked many times, and the usual answer is MyFloat.ToString("0.0")
or something similar. However, the problem I am facing with this is that
float f = 1;
string s = f.ToString("0.0");
MessageBox.Show(s);
outputs 1,0
but what I need is 1.0
. I could of course manually replace the comma with a dot afterwards, but I'm pretty sure that that wouldn't be the proper way to do it.
I wasn't able to find a solution on the internet because everywhere it says that this already outputs 1.0
How come?