public static string AddHex(string hex, int num) { //A long because that's the return type required for ToString long sum = Convert.ToInt64(hex, 16) + num; return Convert.ToString(sum, 16).ToUpper(); }