c# decimal format 2 places code example
Example 1: set decimal point c#
decimalVar.ToString ("#.##"); // returns "" when decimalVar == 0
or
decimalVar.ToString ("0.##"); // returns "0" when decimalVar == 0
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.##");