You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On different machines numbers are being converted in different formats.
the number 26.643470764160158 (using float conversion), on my machine is serialized as 26.64347
but on another machine it was serialized as 2.6xxxE+16. This wouldnt be a problem but when converting back, it ingores the notation, returning 2.6xxx.
To fix this i needed to use
System.Globalization.CultureInfo.DefaultThreadCurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
I had same problem, my program parse "0.05" as null, but only on some devices, i fix this problem with added System.Globalization.CultureInfo.InvariantCulture to convert functions.
Example
n = System.Convert.ToSingle(str,System.Globalization.CultureInfo.InvariantCulture);
This seems to only be an issue with the Asset Store version. It was fixed on GitHub a while ago. I've made a bunch of updates and double-checked that we're using CultureInfo. I'll be updating AssetStore shortly.
On different machines numbers are being converted in different formats.
the number 26.643470764160158 (using float conversion), on my machine is serialized as 26.64347
but on another machine it was serialized as 2.6xxxE+16. This wouldnt be a problem but when converting back, it ingores the notation, returning 2.6xxx.
To fix this i needed to use
System.Globalization.CultureInfo.DefaultThreadCurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
System.Globalization.CultureInfo.DefaultThreadCurrentUICulture** = System.Globalization.CultureInfo.InvariantCulture;
You can add this on JSONObject class, or on each method of System.Convert, call for CultureInfo.InvariantCulture as the second parameter.
Sorry for the rushed post, I'm in a hurry on my project, but wanted to at least let you guys know.
Regards
The text was updated successfully, but these errors were encountered: