converting to double to two decimal places

Use Math.Round

Math.Round(mydoublevalue, 2);

In your code

tbtotal2.Text = Math.Round(total2, 2).ToString(); 

If you only want the value rounded for display as a string, you can also use String.Format.

tbtotal1.Text = String.Format("{0:0.##}", total1);

The text "{0:0.##}" describes how you want it to be formatted. The # indicates that ending zeroes should not be included (eg 1.2 stays the string "1.2"), if you instead do "{0:0.00}", two decimal places are included no matter what, so the double 1.2 would become "1.20".


Do it like this.

 tbtotal1.Text = Math.Round(double.Parse(total1.ToString()), 2).ToString();
 tbtotal2.Text = Math.Round(double.Parse(total2.ToString()), 2).ToString(); 

My answer is pretty late but for those out there like me who want:

to convert to double/decimal and also want the value to always show 2 decimal places (.00) as String

tbtotal2.Text = Math.Round(total2, 2).ToString("#.00"); 

The below means two decimal places at all times.

"#.00"

The below means two decimal places if there is value.

"#.##"