From c95fb78cf4b9ec11fcfc825a8d4c3c0f915be2be Mon Sep 17 00:00:00 2001 From: Stefan Markovic <57057282+stefansjfw@users.noreply.github.com> Date: Thu, 2 Dec 2021 15:07:47 +0100 Subject: [PATCH] [PT Run - Calculator plugin] Allow single-digit factorial (#14736) --- .../CalculateHelper.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/CalculateHelper.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/CalculateHelper.cs index a1ca64aead..e49e36814a 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/CalculateHelper.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/CalculateHelper.cs @@ -28,7 +28,8 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator throw new ArgumentNullException(paramName: nameof(input)); } - if (input.Length <= 2) + bool singleDigitFactorial = input.EndsWith("!", StringComparison.InvariantCulture); + if (input.Length <= 2 && !singleDigitFactorial) { return false; }