Nick Nick - 1 year ago 97
C# Question

Convert a positive number to negative in C#

You can convert a negative number to positive like this:

int myInt = System.Math.Abs(-5);

Is there an equivalent method to make a positive number negative?

Answer Source

How about

myInt = myInt * -1

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download