diff --git a/src/ConfigCatClient/Evaluation/RolloutEvaluator.cs b/src/ConfigCatClient/Evaluation/RolloutEvaluator.cs index d19290f3..1d4993b3 100644 --- a/src/ConfigCatClient/Evaluation/RolloutEvaluator.cs +++ b/src/ConfigCatClient/Evaluation/RolloutEvaluator.cs @@ -868,7 +868,11 @@ private static string UserAttributeValueToString(object attributeValue) } else if (attributeValue.TryConvertNumericToDouble(out var number)) { - return number.ToString(CultureInfo.InvariantCulture).Replace("E", "e"); + var abs = Math.Abs(number); + var format = 1e-7 < abs && abs < 1e21 + ? "0.#################" + : "0.#################e+0"; + return number.ToString(format, CultureInfo.InvariantCulture); } else if (attributeValue.TryConvertDateTimeToDateTimeOffset(out var dateTimeOffset)) {