Skip to content

Commit 1070e60

Browse files
author
bonesoul
committed
Fixed float bases tests for machines not running en-US.
Closes Astn#12.
1 parent a96b3df commit 1070e60

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Json-Rpc/JsonRpcProcessor.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
using System;
2+
using System.Globalization;
3+
using System.Threading;
24
using System.Threading.Tasks;
35
using System.Reflection;
46
using System.IO;
@@ -219,6 +221,9 @@ public static Task<string> Process(string sessionId, string jsonRpc, object cont
219221
{
220222
var task = Task<string>.Factory.StartNew((_) =>
221223
{
224+
// use invariant culture - we have to set it explicitly for every thread we create to
225+
// prevent any floating-point problems (mostly because of number formats in non en-US cultures).
226+
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
222227

223228
var tup = (Tuple<string,string,object>)_;
224229
string _sessionId;

0 commit comments

Comments
 (0)