1
0
mirror of https://github.com/JKorf/CryptoExchange.Net synced 2025-07-09 15:39:00 +00:00

Compare commits

...

2 Commits

Author SHA1 Message Date
Jan Korf
c10671768d
Merge pull request #160 from kulikov-dev/fix/155-format-conversion-error
Fixing exponential format parsing
2022-10-15 13:34:00 +02:00
kulikov-dev
91e8123679 Fixing issue 155 with exponential format parsing (https://github.com/JKorf/CryptoExchange.Net/issues/155) 2022-10-15 09:57:14 +06:00

View File

@ -106,7 +106,7 @@ namespace CryptoExchange.Net.Converters
if ((property.PropertyType == typeof(decimal) if ((property.PropertyType == typeof(decimal)
|| 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)) if (decimal.TryParse(value.ToString(), NumberStyles.Float, CultureInfo.InvariantCulture, out var dec))
property.SetValue(result, dec); property.SetValue(result, dec);