I am writing a program to get data from microcontroller to PC. The data is in float format. I tried to convert the string into float using Convert.ToSingle(string)
, but the conversion result is wrong:
- "0.11" is converted to 11, sometimes 12.
- "0.10" is converted to 10. etc
As you can see, it is losing the leading 0. , which is unexpected. How could this happen?