Software Utilize C#, VS-2005
How to Remove Nagative Sign From Textbox. my code is:
Private void button1_Click(object sender, EventArgs e)
{
decimal t1 = 0;
decimal t2 = 0;
decimal res = 0;
t1 = Convert.ToDecimal(textBox1.Text);
t2 = Convert.ToDecimal(textBox2.Text);
res = t1 - t2;
textBox3.Text = res.ToString();
}
if t1 have value 12000 and t2 have value 20000. so result is 12000-20000 = -8000
I want to remove (-) sign from textbox. How can i do that?
The static
Math.Absmethod is your friend.