int i = 20; string output = Convert.ToString(i, 2); // Base2 formatting i = -20; output = Convert.ToString(i, 2);
Value Expected
If you would get rid of this "effect" - use Math.Abs() method to get number value without sign,
Math.Abs()
string output = Convert.ToString(Math.Abs(i), 2); // Base2