Skip to content

Commit 50ffe3a

Browse files
committed
Percentile aggregator fails on my maching due to issues converting double.
My locale expects doubles to be in the 1,0 format, so the double.parse fails if it tries to parse 1.0. Added CultureInfo.InvariantCulture to the parse to fix this.
1 parent 6c2631b commit 50ffe3a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: src/Nest/Resolvers/Converters/Aggregations/AggregationConverter.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 System.Text.RegularExpressions;
56
using Newtonsoft.Json;
@@ -69,7 +70,7 @@ private IAggregation GetPercentilesMetricAggregation(JsonReader reader, JsonSeri
6970
reader.Read();
7071
while (reader.TokenType != JsonToken.EndObject)
7172
{
72-
var percentile = double.Parse(reader.Value as string);
73+
var percentile = double.Parse(reader.Value as string, CultureInfo.InvariantCulture);
7374
reader.Read();
7475
var value = reader.Value as double?;
7576
percentileItems.Add(new PercentileItem()

0 commit comments

Comments
 (0)