From 56a254e6934ca3419ad819992a2119be8a704f1c Mon Sep 17 00:00:00 2001 From: niksedk Date: Thu, 13 Jan 2022 08:37:27 +0100 Subject: [PATCH] Try to fix frame rate change issue - trhx peter-qgd :) Related to #5700 --- src/ui/Forms/ChangeFrameRate.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ui/Forms/ChangeFrameRate.cs b/src/ui/Forms/ChangeFrameRate.cs index a06418aaf..809e6c28a 100644 --- a/src/ui/Forms/ChangeFrameRate.cs +++ b/src/ui/Forms/ChangeFrameRate.cs @@ -2,6 +2,7 @@ using Nikse.SubtitleEdit.Logic; using System; using System.Drawing; +using System.Globalization; using System.Windows.Forms; namespace Nikse.SubtitleEdit.Forms @@ -97,7 +98,8 @@ namespace Nikse.SubtitleEdit.Forms return; } - if (double.TryParse(comboBoxFrameRateFrom.Text, out _) && double.TryParse(comboBoxFrameRateTo.Text, out _)) + if (double.TryParse(comboBoxFrameRateFrom.Text.Replace(',', '.'), NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out _) && + double.TryParse(comboBoxFrameRateTo.Text.Replace(',', '.'), NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out _)) { DialogResult = DialogResult.OK; } @@ -116,8 +118,8 @@ namespace Nikse.SubtitleEdit.Forms comboBoxFrameRateTo.Text = oldFrameRate; } - public double OldFrameRate => double.Parse(comboBoxFrameRateFrom.Text); + public double OldFrameRate => double.Parse(comboBoxFrameRateFrom.Text.Replace(',', '.'), NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture); - public double NewFrameRate => double.Parse(comboBoxFrameRateTo.Text); + public double NewFrameRate => double.Parse(comboBoxFrameRateTo.Text.Replace(',', '.'), NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture); } }