diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator.UnitTest/ExtendedCalculatorParserTests.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator.UnitTest/ExtendedCalculatorParserTests.cs index 32edd69527..99ae3d7099 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator.UnitTest/ExtendedCalculatorParserTests.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator.UnitTest/ExtendedCalculatorParserTests.cs @@ -32,7 +32,7 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator.UnitTests var engine = new CalculateEngine(); // Act - Assert.ThrowsException(() => engine.Interpret(input)); + Assert.ThrowsException(() => engine.Interpret(input, CultureInfo.CurrentCulture)); } [DataTestMethod] @@ -46,7 +46,7 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator.UnitTests var engine = new CalculateEngine(); // Act - var result = engine.Interpret(input); + var result = engine.Interpret(input, CultureInfo.CurrentCulture); // Assert Assert.AreEqual(default(CalculateResult), result); diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/CalculateEngine.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/CalculateEngine.cs index 1ffd6c3179..fc2d76f836 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/CalculateEngine.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/CalculateEngine.cs @@ -21,12 +21,10 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator public const int RoundingDigits = 10; - public CalculateResult Interpret(string input) - { - // Using CurrentCulture this is user facing - return Interpret(input, CultureInfo.CurrentCulture); - } - + /// + /// Interpret + /// + /// Use CultureInfo.CurrentCulture if something is user facing public CalculateResult Interpret(string input, CultureInfo cultureInfo) { if (!CalculateHelper.InputValid(input)) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/Microsoft.PowerToys.Run.Plugin.Calculator.csproj b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/Microsoft.PowerToys.Run.Plugin.Calculator.csproj index b7deda8bd4..7ebb02e5dc 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/Microsoft.PowerToys.Run.Plugin.Calculator.csproj +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/Microsoft.PowerToys.Run.Plugin.Calculator.csproj @@ -13,6 +13,8 @@ false x64 en-US + true + Recommended