From 8eaf3a72e588583db6d13e430b732a04fb7d2ed2 Mon Sep 17 00:00:00 2001 From: Kevin Venclovas Date: Fri, 26 Jan 2024 11:57:50 +0100 Subject: [PATCH] fixed the number converting german/american writing --- Source/FikaAmazonAPI/ReportGeneration/DataConverter.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/FikaAmazonAPI/ReportGeneration/DataConverter.cs b/Source/FikaAmazonAPI/ReportGeneration/DataConverter.cs index 08feca17..66670b63 100644 --- a/Source/FikaAmazonAPI/ReportGeneration/DataConverter.cs +++ b/Source/FikaAmazonAPI/ReportGeneration/DataConverter.cs @@ -32,7 +32,7 @@ public static class DateTimeFormat } public static decimal? GetDecimal(string str) { - if (decimal.TryParse(str, NumberStyles.Any, DataConverterCultureInfo, out decimal value)) + if (decimal.TryParse(str.Replace(",","."), NumberStyles.Any, new CultureInfo("en-US"), out decimal value)) { return value; } @@ -40,7 +40,7 @@ public static class DateTimeFormat } public static int? GetInt(string str) { - if (int.TryParse(str, NumberStyles.Integer, DataConverterCultureInfo, out int value)) + if (int.TryParse(str.Replace(",", "."), NumberStyles.Integer, new CultureInfo("en-US"), out int value)) { return value; } @@ -48,7 +48,7 @@ public static class DateTimeFormat } public static double? GetDouble(string str) { - if (double.TryParse(str, NumberStyles.Any, DataConverterCultureInfo, out double value)) + if (double.TryParse(str.Replace(",", "."), NumberStyles.Any, new CultureInfo("en-US"), out double value)) { return value; }