66using System . IO ;
77using System . Threading ;
88using System . Linq ;
9-
9+ using System . Globalization ;
1010
1111namespace UXF
1212{
@@ -19,6 +19,13 @@ public class FileSaver : LocalFileDataHander
1919 [ Tooltip ( "Enable to sort session files into folders. The trial_results CSV is never put into a folder." ) ]
2020 public bool sortDataIntoFolders = true ;
2121
22+ /// <summary>
23+ /// Enable to force the data to save with an english-US format (i.e. `,` to serapate values,
24+ /// and `.` to separate decimal points).
25+ /// </summary>
26+ [ Tooltip ( "Enable to force the data to save with an english-US format (i.e. `,` to serapate values, and `.` to separate decimal points)." ) ]
27+ public bool forceENUSLocale = true ;
28+
2229 /// <summary>
2330 /// Enable to print debug messages to the console.
2431 /// </summary>
@@ -45,12 +52,21 @@ public class FileSaver : LocalFileDataHander
4552 /// </summary>
4653 public override void SetUp ( )
4754 {
55+ if ( forceENUSLocale )
56+ {
57+ Thread . CurrentThread . CurrentCulture = new CultureInfo ( "en-US" ) ;
58+ }
59+
4860 quitting = false ;
4961 Directory . CreateDirectory ( base . StoragePath ) ;
5062
5163 if ( ! IsActive )
5264 {
5365 parallelThread = new Thread ( Worker ) ;
66+ if ( forceENUSLocale )
67+ {
68+ parallelThread . CurrentCulture = new CultureInfo ( "en-US" ) ;
69+ }
5470 parallelThread . Start ( ) ;
5571 }
5672 else
@@ -150,7 +166,7 @@ public override string HandleDataTable(UXFDataTable table, string experiment, st
150166 if ( verboseDebug ) Utilities . UXFDebugLogFormat ( "Queuing save of file: {0}" , savePath ) ;
151167
152168 ManageInWorker ( ( ) => { File . WriteAllLines ( savePath , lines ) ; } ) ;
153- return GetRelativePath ( StoragePath , savePath ) ; ;
169+ return GetRelativePath ( StoragePath , savePath ) ;
154170 }
155171
156172 public override string HandleJSONSerializableObject ( List < object > serializableObject , string experiment , string ppid , int sessionNum , string dataName , UXFDataType dataType , int optionalTrialNum = 0 )
0 commit comments