1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-08-11 16:32:57 +00:00

Merge pull request #160 from kulikov-dev/fix/155-format-conversion-error

Fixing exponential format parsing
This commit is contained in:
Jan Korf
2022-10-15 13:34:00 +02:00
committed by GitHub
@@ -106,7 +106,7 @@ namespace CryptoExchange.Net.Converters
if ((property.PropertyType == typeof(decimal)
|| property.PropertyType == typeof(decimal?))
&& (value != null && value.ToString().Contains("e")))
&& (value != null && value.ToString().IndexOf("e", StringComparison.OrdinalIgnoreCase) >= 0))
{
if (decimal.TryParse(value.ToString(), NumberStyles.Float, CultureInfo.InvariantCulture, out var dec))
property.SetValue(result, dec);