Expand|Select|Wrap|Line Numbers
- private void button1_Click(object sender, EventArgs e)
- {
- decimal? t1 = null;
- decimal? t2 = null;
- decimal? t3 = null;
- decimal res = 0;
- t1 = Convert.ToDecimal(textBox1.Text);
- t2 = Convert.ToDecimal(textBox2.Text);
- t3 = Convert.ToDecimal(textBox3.Text);
- res = Math.Abs(t1 + t2 - t3);
- textBox4.Text = res.ToString();
- }
1. "The best overloaded method match for System.Math.Abs(sbyte)' has some invalid arguments"
2. "Argument'1' cannot convert from decimal to sbyte"
Actually i am trying to remove negative sign from the result of calculation. e.g.
textbox1.text value = 10
textbox2.text value = 10
textbox3.text value = 40
Then Result is -20, I want to remove '-' sign from the result.
How to solve it?.