c# decimal to max 2 decimal places code example
Example 1: decimal c# 2 digits
decimal.Round(yourValue, 2, MidpointRounding.AwayFromZero);
Example 2: decimal c# 2 digits
decimalVar.ToString ("0.##"); // returns "0" when decimalVar == 0
decimal.Round(yourValue, 2, MidpointRounding.AwayFromZero);
decimalVar.ToString ("0.##"); // returns "0" when decimalVar == 0