diff --git a/UnitsNet.Tests/QuantityFormatterTests.cs b/UnitsNet.Tests/QuantityFormatterTests.cs index 9a2a948ca1..1a4d2315eb 100644 --- a/UnitsNet.Tests/QuantityFormatterTests.cs +++ b/UnitsNet.Tests/QuantityFormatterTests.cs @@ -1,6 +1,7 @@ // Licensed under MIT No Attribution, see LICENSE file at the root. // Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet. +using System.Globalization; using Xunit; namespace UnitsNet.Tests @@ -108,7 +109,7 @@ public static void StandardNumericFormatStrings_Equals_ValueWithFormatStringAndA { var length = Length.FromMeters(123456789.987654321); - var expected = string.Format($"{{0:{format}}} {{1:a}}", length.Value, length); + var expected = string.Format(CultureInfo.CurrentUICulture, $"{{0:{format}}} {{1:a}}", length.Value, length); Assert.Equal(expected, QuantityFormatter.Format(length, format)); } @@ -132,7 +133,7 @@ public static void CustomNumericFormatStrings_Equals_ValueWithFormatStringAndAbb { var length = Length.FromMeters(123456789.987654321); - var expected = string.Format($"{{0:{format}}} {{1:a}}", length.Value, length); + var expected = string.Format(CultureInfo.CurrentUICulture, $"{{0:{format}}} {{1:a}}", length.Value, length); Assert.Equal(expected, QuantityFormatter.Format(length, format)); } }