コード例 #1
0
 public static string ConvertImm(string number)
 {
     if (DataCleaner.CheckNumberType(number) == NUM_TYPES.OTH)
     {
         return(number);
     }
     return(ConvertHexToBin(number));
 }
コード例 #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);
        }
コード例 #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);
        }