c# double number of decimal places code example
Example 1: c# double value with 2 decimal places
inputValue = Math.Round(inputValue, 2);
Example 2: format double to 2 decimal places in c#
priceLbl.Text = price.ToString("0.##");
Example 3: decimal c# 2 digits
decimalVar.ToString ("0.##"); // returns "0" when decimalVar == 0