float round to 2 decimal places 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: c# round to 2 decimal places
decimal b = 1.995555M;
Math.Round(b, 2); //returns 2.00