FirebaseRemoteConfig.GetValue(key).DoubleValue gives an Exception when device language is set to French or Russian.
On investigating, it's found that languages like French or Russian use ',' instead of '.' in their fractional values. So, a value of '0.25' in French will be '0,25'.
So, when a remote config double value is fetched it throws the exception.
If you use FirebaseRemoteConfig.GetValue(key).StringValue, value is printed correctly.
FirebaseRemoteConfig.GetValue(key).DoubleValueif (Single.TryParse(FirebaseRemoteConfig.GetValue(key).StringValue, NumberStyles.Float, CultureInfo.InvariantCulture, out val)) {
return val;
}
Thanks for this report! If you wouldn't mind confirming that you see this behaviour with the quick start app, I'll be able to pull this in as a bug.
Thanks for this report! If you wouldn't mind confirming that you see this behaviour with the quick start app, I'll be able to pull this in as a bug.
Yes, seeing the same behavior in quick start app as well.
@kashif789us thanks for testing and verifying that you can reproduce this issue in quickstart app.
We will look into this and keep you posted.
Seems to be an issue in Unity SDK when we convert string to double using System.Convert.ToDouble(StringValue), without passing IFormatProvider.
This should be System.Convert.ToDouble(StringValue, CultureInfo.InvariantCulture) instead.
I'll prepare a patch for this. At the meantime, you can use your workaround or simply double.Parse(FirebaseRemoteConfig.GetValue(key).StringValue, CultureInfo.InvariantCulture)
Sorry for the inconvenience
Shawn