From f3852b5e64bff15f2f3bbe6025ee8a6a0660cf93 Mon Sep 17 00:00:00 2001 From: Carl Chang Date: Sat, 25 Nov 2023 20:06:11 +0100 Subject: [PATCH] fix crashing issue when decimal symbol is not a period. update version; --- Helpers/Converters.cs | 6 +++--- Properties/AssemblyInfo.cs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Helpers/Converters.cs b/Helpers/Converters.cs index ca2ea13..372b431 100644 --- a/Helpers/Converters.cs +++ b/Helpers/Converters.cs @@ -102,8 +102,8 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu public class MathMultiplyConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { - if (!(value is double)) value = System.Convert.ToDouble(value); - if (!(parameter is double)) parameter = System.Convert.ToDouble(parameter); + if (!(value is double)) value = System.Convert.ToDouble(value, culture); + if (!(parameter is double)) parameter = System.Convert.ToDouble(parameter, culture); return (double)value * (double)parameter; } @@ -115,7 +115,7 @@ public object ConvertBack(object value, Type targetType, object parameter, Cultu public class ThicknessMultiplyConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { - var val = System.Convert.ToDouble(value); + var val = System.Convert.ToDouble(value, culture); var paras = (parameter as string)?.Split(',', ' '); if (paras?.Length == 4) return new Thickness(val * double.Parse(paras[0]), diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 6056541..3bbf51a 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -51,5 +51,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.2.8.0")] -[assembly: AssemblyFileVersion("1.2.8.0")] +[assembly: AssemblyVersion("1.2.9.0")] +[assembly: AssemblyFileVersion("1.2.9.0")]