Skip to content

Commit

Permalink
[PTRun][Calc]Add list separator handling for different cultures
Browse files Browse the repository at this point in the history
  • Loading branch information
PesBandi committed Jan 7, 2025
1 parent 809791d commit 6441fec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public void Translate_WhenCalledEmpty(string input)
[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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private static string Translate(string input, CultureInfo cultureFrom, CultureIn
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));
}
}

Expand Down

0 comments on commit 6441fec

Please sign in to comment.