diff --git a/src/Microsoft.ML.AutoML/Utils/MLNetUtils/Conversions.cs b/src/Microsoft.ML.AutoML/Utils/MLNetUtils/Conversions.cs index b8cf657ad9..2c533535ce 100644 --- a/src/Microsoft.ML.AutoML/Utils/MLNetUtils/Conversions.cs +++ b/src/Microsoft.ML.AutoML/Utils/MLNetUtils/Conversions.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System; +using System.Globalization; namespace Microsoft.ML.AutoML { @@ -25,7 +26,7 @@ public static bool TryParse(in TX src, out R4 dst) dst = R4.NaN; return true; } - if (float.TryParse(str, out dst)) + if (float.TryParse(str, NumberStyles.Float, CultureInfo.InvariantCulture, out dst)) { return true; } diff --git a/src/Microsoft.ML.AutoML/Utils/SweepableParamAttributes.cs b/src/Microsoft.ML.AutoML/Utils/SweepableParamAttributes.cs index b575e8bc80..ae7945d21e 100644 --- a/src/Microsoft.ML.AutoML/Utils/SweepableParamAttributes.cs +++ b/src/Microsoft.ML.AutoML/Utils/SweepableParamAttributes.cs @@ -3,6 +3,7 @@ // See the LICENSE file in the project root for more information. using System; +using System.Globalization; using System.Linq; using System.Text; @@ -144,7 +145,7 @@ public SweepableFloatParam(float min, float max, float stepSize = -1, int numSte public override void SetUsingValueText(string valueText) { - RawValue = float.Parse(valueText); + RawValue = float.Parse(valueText, CultureInfo.InvariantCulture); } public override SweepableParam Clone() =>