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();
}
Ramesh MaruthiRank #937 · 2.2K reputationPosted Jul 1, 2015, 9:59 AM EDT
IsraelRank #1,223 · 1.5K reputationPosted Jul 1, 2015, 2:42 PM EDT
Ramesh MaruthiRank #937 · 2.2K reputationPosted Jul 1, 2015, 3:39 PM EDT
IsraelRank #1,223 · 1.5K reputationPosted Jul 1, 2015, 3:53 PM EDT
Ramesh MaruthiRank #937 · 2.2K reputationPosted Jul 1, 2015, 4:51 PM EDT
RakeshRank #397 · 6.3K reputationPosted Jul 1, 2015, 7:28 PM EDT
IsraelRank #1,223 · 1.5K reputationPosted Jul 2, 2015, 4:10 AM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts