Beispiel #1
0
 public static string ConvertImm(string number)
 {
     if (DataCleaner.CheckNumberType(number) == NUM_TYPES.OTH)
     {
         return(number);
     }
     return(ConvertHexToBin(number));
 }
Beispiel #2
0
        public static string ConvertNumber(string number)
        {
            NUM_TYPES type = DataCleaner.CheckNumberType(number);

            if (type == NUM_TYPES.DEC)
            {
                return(ConvertDecToBin(number));
            }

            if (type == NUM_TYPES.HEX)
            {
                return(ConvertHexToBin(number));
            }

            return(number);
        }
Beispiel #3
0
        public static string ConvertToHex(string number)
        {
            if (number.StartsWith("0x"))
            {
                number = number.Remove(0, 2);
            }

            NUM_TYPES type = DataCleaner.CheckNumberType(number);

            if (type == NUM_TYPES.DEC)
            {
                return(ConvertDecToHex(number));
            }

            return(number);
        }