reinterpretcat / utymap

Highly customizable library for procedural world generation based on real map data
Apache License 2.0
958 stars 151 forks source link

String.Format("{0}", 42.5) returns "42,5" in Germany #133

Closed kamisori closed 5 years ago

kamisori commented 5 years ago

https://github.com/reinterpretcat/utymap/blob/39cb7684bf014ecc770ed1c46d953f13e103f3f5/unity/library/UtyMap.Unity/Infrastructure/Config/ConfigBuilder.cs#L104

Hi, in the above line and probably some others, in the format string it is neccessary to specify what decimal separator to use, because otherwise it uses the systems' locale instead.

I'll have a closer look where to do this and will submit a patch for this in a bit.

Edit: I think it might be better to specify the locale that is supposed to be used instead, like so:

var queryString = String.Format(System.Globalization.CultureInfo.GetCultureInfo("en-US"), _mapDataServerQuery,
                query.MinPoint.Latitude - padding, query.MinPoint.Longitude - padding,
                query.MaxPoint.Latitude + padding, query.MaxPoint.Longitude + padding);

here:

https://github.com/reinterpretcat/utymap/blob/841359d7e1ba109b8cb014ad9f113cb30b374686/unity/library/UtyMap.Unity/Data/Providers/Geo/OpenStreetMapDataProvider.cs#L41

reinterpretcat commented 5 years ago

Thanks! I'm not working on the project actively anymore, but still happy to improve it a bit.

kamisori commented 5 years ago

Ok, I'll fork this and try to get the third person scene to work tonight with this change and come back with a pull request once i'm happy.