DecimalPrecision

CSharp · Console

/Program.cs

using System;
					
public class Program
{
	public static void Main()
	{
		
		decimal d = 1.23M;
		decimal r1 = decimal.Add(d, 0.000M);
		decimal r2 = d + 0.000M;
		Console.WriteLine("Result1 = " + r1.ToString());  // 1.230 with both dotnetfiddle and Visual Studio 2015
		Console.WriteLine("Result2 = " + r2.ToString());  // 1.23 on dotnetfiddle; 1.230 with Visual Studio 2015
	}
}
;