I have a strange problem. When my custom formatted Hex value is tested with double.Tryparse it returns inconsistent results
For example
if (double.TryParse(dblValue, NumberStyles.Float, CultureInfo.InvariantCulture, out double x))
If the dblValue = "0E-63" the above statement returns true and if dblValue = "0E-5B" it returns false I expect both of these custom formatted hex values to return false in TryParse, so that my code handles them as not a number. What am I missing here.
other than this double and integers are working as expected.
0E-63is a valid decimal number in scientific format,0E-5Bis not. Thats why it parses the first one but not the second one.NumberStyles.Numberthen trying to parse scientific notation would fail, but it's not clear if that's the intent here or not since hex values are typically parsed to integer types and do not contain dashes. Is the intent to parse the base and exponent as separate hex numbers?NumberStyles.Numberdid the job for me.