I understand that there are rounding errors but can anyone explain why I get such different results using these different methods:
decimal amount = 9.990M;
var cost = Convert.ToInt32(amount*1000);
var cost1 = (int) amount*1000;
I get:
cost = 9990
cost1 = 9000
The second one should be
You have to multiply with 1000 and then convert the result. In your example you are converting first and then multiplying.
See Operator precedence and associativity