two digits after decimal point in c# code example
Example 1: c# display float with 2 decimal places
myFloatVariable.ToString("0.00"); //2dp Number
myFloatVariable.ToString("n2"); // 2dp Number
myFloatVariable.ToString("c2"); // 2dp currency
Example 2: decimal c# 2 digits
decimalVar.ToString ("#.##"); // returns "" when decimalVar == 0
Example 3: decimal c# 2 digits
decimalVar.ToString ("0.##"); // returns "0" when decimalVar == 0