Israel

Israel

  • 693
  • 1.3k
  • 219.4k

How to convert in Decimal number please

Jul 1 2015 1:15 PM
Hi!
 
I need same help. I navigate in internet I didnt find.
How can I convert all these textbox to decimal. Even the last result should display a decimal number.
 
Thanxin advance! 
 
private void lblTotal1_TextChanged(object sender, EventArgs e)
{
decimal d1, d2, d3, d4, total;
decimal.TryParse(lblTotal1.Text, out d1);
decimal.TryParse(lblTotal2.Text, out d2);
decimal.TryParse(lblTotal3.Text, out d3);
decimal.TryParse(lblTotal4.Text, out d4);
 
total = d1 + d2 + d3 + d4;
lblTotal.Text = total.ToString();
}
 

Answers (7)