diff --git a/YahooFinance.Core/YahooFinance.Core/Core/Converters/DecimalCsvConverter.cs b/YahooFinance.Core/YahooFinance.Core/Core/Converters/DecimalCsvConverter.cs index 654e6ab..9cb910e 100644 --- a/YahooFinance.Core/YahooFinance.Core/Core/Converters/DecimalCsvConverter.cs +++ b/YahooFinance.Core/YahooFinance.Core/Core/Converters/DecimalCsvConverter.cs @@ -2,6 +2,7 @@ using CsvHelper.Configuration; using CsvHelper.TypeConversion; using System; +using System.Globalization; namespace MatthiWare.YahooFinance.Core.Converters { @@ -9,14 +10,15 @@ namespace MatthiWare.YahooFinance.Core.Converters public class DecimalCsvConverter : DefaultTypeConverter { /// - public override object ConvertFromString(string text, IReaderRow row, MemberMapData memberMapData) + public override object ConvertFromString( + string text, + IReaderRow row, + MemberMapData memberMapData + ) { - if (!decimal.TryParse(text, out var convertedDecimal)) - { - return decimal.MinValue; - } - - return convertedDecimal; + return decimal.TryParse(text, NumberStyles.Any, CultureInfo.InvariantCulture, out var convertedDecimal) + ? convertedDecimal + : decimal.MinValue; } } -} +} \ No newline at end of file