G
Guest
Hi,
How can I convert positive integers to negative integers. Eg 1 to -1.
Thanks
How can I convert positive integers to negative integers. Eg 1 to -1.
Thanks
Chris said:Hi,
How can I convert positive integers to negative integers. Eg 1 to -1.
Chris said:Based on performance. Do you think this is fast
TextBox2.Text = (Abs(Convert.ToDecimal(TextBox1.Text)) * -1).ToString()
Thanks
Easiest way
myNumber = myNumber * (-1);
or silly way
myNumber = myNumber - (myNumber * 2);