Format decimal to two places or a whole number
It seems to me that the decimal precision is intrinsic to the decimal type, which defaults to 4 decimal places. If I use the following code:
decimal value = 8.3475M;
Console.WriteLine(value);
decimal newValue = decimal.Round(value, 2);
Console.WriteLine(newValue);
The output is:
8.3475
8.35
decimal num = 10.11M;
Console.WriteLine( num.ToString( "0.##" ) );