Browse Source

Fix parse double exception which occures if you try to run tests in

environment with Non-English default locale
v2
Artyom Baranovskiy 14 years ago
parent
commit
7d546cec00
  1. 6
      src/UnitTests/StatisticsTests/StatTestData.cs

6
src/UnitTests/StatisticsTests/StatTestData.cs

@ -24,6 +24,8 @@
// OTHER DEALINGS IN THE SOFTWARE. // OTHER DEALINGS IN THE SOFTWARE.
// </copyright> // </copyright>
using System.Globalization;
namespace MathNet.Numerics.UnitTests.StatisticsTests namespace MathNet.Numerics.UnitTests.StatisticsTests
{ {
using System.Collections.Generic; using System.Collections.Generic;
@ -87,7 +89,7 @@ namespace MathNet.Numerics.UnitTests.StatisticsTests
line = line.Trim(); line = line.Trim();
if (!line.Equals(string.Empty)) if (!line.Equals(string.Empty))
{ {
list.Add(double.Parse(line)); list.Add(double.Parse(line, CultureInfo.InvariantCulture));
} }
line = reader.ReadLine(); line = reader.ReadLine();
@ -117,7 +119,7 @@ namespace MathNet.Numerics.UnitTests.StatisticsTests
return 0; return 0;
} }
return double.Parse(str.Substring(start + 1).Trim()); return double.Parse(str.Substring(start + 1).Trim(), CultureInfo.InvariantCulture);
} }
} }
} }

Loading…
Cancel
Save