When I try to set the z variable in the code below, I get this compile time error:
Operator ‘*’ cannot be applied to operands of type ‘double’ and ‘decimal’
decimal x = 1, y = 2, z; // There are two ways I set the z variable: z = (x*y)*(.8 * 1.732050808m); z = (1000 * x)/(y * 1.732050808m)* .8;
Why is that, and how do I solve it?
Be sure to use
.8minstead of.8.