Hello everyone,
As mentioned here,
http://msdn.microsoft.com/en-us/library/system.decimal(VS.80).aspx
"Conversions from Decimal to other types are narrowing conversions that round the Decimal value to the nearest integer value toward zero."
It conflicts my previous understanding that in all rounding in C#, we round to the nearest integer. Here is my test code. How strange it is, right?
[Code]using System;
class Test{ static void Main() { Decimal b = 100.9M; int a = (int)b;
// output 100, other than 101 Console.WriteLine(a);
return; }}[/Code]
thanks in advance,George