round double to 2 decimal places c# code example
Example 1: c# double value with 2 decimal places
inputValue = Math.Round(inputValue, 2);
Example 2: c# round to 2 decimal places
decimal b = 1.995555M;
Math.Round(b, 2); //returns 2.00
Example 3: format double to 2 decimal places in c#
priceLbl.Text = price.ToString("0.##");
Example 4: C# decimal with two places store as string with two places
public static string DoFormat( double myNumber )
{
var s = string.Format("{0:0.00}", myNumber);
return s;
}