I need all values to rounded to two decimal places. So 1.401 should round to 1.40, but Math.Round(value, 2) rounds to 1.4.
Math.Round(value, 2)
How can I force the trailing zero?
1.4 is the same as 1.40 - you just want to display it differently. Use a format string when calling ToString - like value.ToString("0.00")
1.4
1.40
ToString
value.ToString("0.00")
2.1m questions
2.1m answers
60 comments
57.0k users