I have noticed some people writing code like this to get a decimal in their code:
decimal amount = decimal.Parse("10.00");
It’s not that obvious, but you can write this which is better:
decimal amount = 10.00M;
If you don’t include the M then the compiler thinks you are typing a double which is why it won’t compile.
technorati tags: c#