Skip to content

Commit

Permalink
Adding invariant culture qualifier to all calls to float and double P…
Browse files Browse the repository at this point in the history
…arse methods (#1855)
  • Loading branch information
pre10der89 authored and reseul committed Jun 1, 2018
1 parent c4d5774 commit 2e08295
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Expand Up @@ -8,6 +8,7 @@
using ReactNative.Reflection;
using ReactNative.UIManager.Annotations;
using System;
using System.Globalization;
using static System.FormattableString;

namespace ReactNative.UIManager
Expand Down Expand Up @@ -460,7 +461,7 @@ private static YogaValue ToYogaValue(JValue value)

if (s.EndsWith("%"))
{
return YogaValue.Percent(float.Parse(s.Substring(0, s.Length - 1)));
return YogaValue.Percent(float.Parse(s.Substring(0, s.Length - 1), CultureInfo.InvariantCulture));
}

throw new InvalidOperationException(
Expand Down
3 changes: 2 additions & 1 deletion ReactWindows/ReactNative.Shared/UIManager/TransformHelper.cs
Expand Up @@ -5,6 +5,7 @@

using Newtonsoft.Json.Linq;
using System;
using System.Globalization;
using System.Linq;
#if WINDOWS_UWP
using Windows.UI.Xaml.Media.Media3D;
Expand Down Expand Up @@ -119,7 +120,7 @@ private static double ConvertToRadians(JObject transformMap, string key)
stringValue = stringValue.Substring(0, stringValue.Length - 3);
}

value = double.Parse(stringValue);
value = double.Parse(stringValue, CultureInfo.InvariantCulture);
}
else
{
Expand Down

0 comments on commit 2e08295

Please sign in to comment.