input: Write a function named `convert_to_binary` that converts a given number into its binary format. If the number is 0, the function should return 0. Otherwise, it should return the binary representation as a string. The function should handle both positive and negative integers.
  assert convert_to_binary(10)=='1010'
  assert convert_to_binary(0)==0
  assert convert_to_binary(-10)=='1010'
output: def convert_to_binary(num):
      if num == 0:
          return 0
      elif num > 0:
          return bin(num)[2:]
      else:
          return bin(num)[3:]