The expression on the right-hand side generates a value of type double. This
cannot be assigned to a float without casting. So,
Option1: cast the whole expr to float: (float)(fltPCRateStd * 1.175)
Option2: Suffix 'f' for the literal value so that the expr results in a
float type value which can be assigned to a float type var: fltPCRateStd *
1.175f
HTH
"Mike P" <mr*@telcoelectronics.co.uk> wrote in message
news:uW*************@TK2MSFTNGP11.phx.gbl...
Why does this cause the error 'cannot implicitly convert type 'double'
to 'float'? Can you not multiply doubles by floats without converting
them all to the same datatype?
fltPCRateStd = fltPCRateStd * 1.175;
Regards,
Mike
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!