I need double value to be rounded to 2 digits. What is preferrable?
String.Format(\"{0:0.00}\", 123.4567); // \"123.46\" Math.Round(123.4567, 2)
Math.Round will not add any decimal places if there aren't any to begin with. String.Format will. e.g.: Math.Round(2) returns 2; String.Format("{0:0.00}",2) returns 2.00;
Math.Round
String.Format
Math.Round(2)
String.Format("{0:0.00}",2)