code: function converter(number, type) {
          if (number < 0) {
              number = 0xFFFFFFFF + number + 1;
          }
          number = parseInt(number.toString(), 10);
          switch (type) {
              case 'B':
                  return number.toString(2);
              case 'O':
                  return number.toString(8);
              case 'H':
                  return number.toString(16);
              default:
                  return number.toString(10);
          }
      }
docs: Helper