1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-08-22 05:42:53 +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) 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);