Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/Nest/QueryDsl/Geo/GeoLocation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public static GeoLocation TryCreate(double latitude, double longitude)

public override string ToString()
{
return string.Format(CultureInfo.InvariantCulture, "{0},{1}", _latitude, _longitude);
return _latitude.ToString("#0.0#######") + "," + _longitude.ToString("#0.0#######");
}

public bool Equals(GeoLocation other)
Expand Down Expand Up @@ -112,6 +112,9 @@ public override int GetHashCode() =>

public static implicit operator GeoLocation(string latLon)
{
if (string.IsNullOrEmpty(latLon))
throw new ArgumentNullException(nameof(latLon));

var parts = latLon.Split(',');
if (parts.Length != 2) throw new ArgumentException("Invalid format: string must be in the form of lat,lon");
double lat;
Expand Down