Fixed bug with ,2 reading as 2 instead of .2

This commit is contained in:
evinnichenko 2024-06-06 19:31:45 -07:00
parent e6b6dc8707
commit 5e04c23e1e

View File

@ -135,13 +135,10 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator
{
if (!string.IsNullOrEmpty(token))
{
if (char.IsDigit(token[0]))
{
var separatorRegex = new Regex(@"[^\d](?=.*[^\d])");
token_bis = separatorRegex.Replace(token, string.Empty);
var separatorRegex2 = new Regex(@"[^\d]");
token_bis = separatorRegex2.Replace(token_bis, cultureFrom.NumberFormat.NumberDecimalSeparator);
}
var separatorRegex = new Regex(@"[^\d](?=.*[^\d])");
token_bis = separatorRegex.Replace(token, string.Empty);
var separatorRegex2 = new Regex(@"[^\d]");
token_bis = separatorRegex2.Replace(token_bis, cultureFrom.NumberFormat.NumberDecimalSeparator);
}
}