[PTRun][Calc]Add list separator handling for different cultures

This commit is contained in:
PesBandi 2025-01-07 18:59:19 +01:00
parent 809791da25
commit 6441fec614
2 changed files with 2 additions and 1 deletions

View File

@ -74,6 +74,7 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator.UnitTests
[DataRow("5,2+6", "5.2+6")]
[DataRow("round(2,5)", "round(2.5)")]
[DataRow("3,3333", "3.3333")]
[DataRow("max(2;3)", "max(2,3)")]
public void Translate_NoErrors_WhenCalled(string input, string expectedResult)
{
// Arrange

View File

@ -123,7 +123,7 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator
outputBuilder.Append(
decimal.TryParse(token, NumberStyles.Number, cultureFrom, out number)
? (new string('0', leadingZeroCount) + number.ToString(cultureTo))
: token);
: token.Replace(cultureFrom.TextInfo.ListSeparator, cultureTo.TextInfo.ListSeparator));
}
}