MSDN says:
\"Without the suffix m, the number is treated as a double, thus generating a compiler error.\"
What does the \"M\" in:
decimal curren
decimal current = 10.99M;
Tells the compiler you want a decimal number.
decimal current = (decimal)10.99
Tells the compiler you want to cast your double 10.99
to a decimal.
Some say it stands for money. M because you must use decimals in financial applications. You must use decimals because they are more accurate than floating point numbers (double).
The decimal suffix is M/m since D/d was already taken by double. Although it has been suggested that M stands for money, Peter Golde recalls that M was chosen simply as the next best letter in decimal.
The decimal has more significant figures than the double, therefore it can be more precise- it also takes up slightly more memory. Other than certian math or physics-related algorithms, the double or float should do fine.
For example
If you do ANYNUMBER / 0.5d you will not get the half of ANYNUMBER.
If you do ANYNUMBER / 0.5m you will get everytime the half of ANYNUMBER.
Use decimal
for money
Use double
for exchange rates