Why is fvalue1 123456792 after the following line of code has executed?
float fvalue1 = Convert.ToSingle("123456789", CultureInfo.InvariantCulture);
Converting to double works as expected:
double dvalue1 = Convert.ToDouble("123456789", CultureInfo.InvariantCulture);
You’ve just discovered for yourself the reason double type exists – its precision is better then float’s.
Check out following on the differences between these types: Difference between decimal, float and double in .NET?