2
Answers

Why does this not work with float?

Hi

Hi

this code gives an error (cannot implicitely convert double to float.

 float pm100, m100=10,56F;

  pm100 = Math.Round(1000 + (10 - m100)*100,0);

I know the solution:  pm100 = Convert.ToSingle(Math.Round(1000 + (10 - m100)*100,0));

But why can't Math.Round work with float?

Thanks

Answers (2)