Skip to content

Commit 6dfdcab

Browse files
committed
Fix geolocation for cultures that have a different separator for decimals
This fixes the geolocation for cultures like the Dutch culture that separate decimals with a comma instead of a point.
1 parent 28e1085 commit 6dfdcab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Source/Shared/EventBuilder.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Globalization;
34
using System.Linq;
45
using Exceptionless.Plugins;
56
using Exceptionless.Extensions;
@@ -117,7 +118,7 @@ public EventBuilder SetGeo(double latitude, double longitude) {
117118
if (longitude < -180.0 || longitude > 180.0)
118119
throw new ArgumentOutOfRangeException("longitude", "Must be a valid longitude value between -180.0 and 180.0.");
119120

120-
Target.Geo = latitude.ToString("#0.0#######") + "," + longitude.ToString("#0.0#######");
121+
Target.Geo = latitude.ToString("#0.0#######", CultureInfo.InvariantCulture)) + "," + longitude.ToString("#0.0#######", CultureInfo.InvariantCulture);
121122
return this;
122123
}
123124

0 commit comments

Comments
 (0)