Hex To Decimal this can work with negative hex
var n = Convert.ToInt32(hexString.Replace("-", ""), 16); return hexString.StartsWith("-") ? n * -1 : n;