From ef112e6ee72df1789d30864ebe9e9900237e18e7 Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Wed, 28 Mar 2018 14:32:40 -0700 Subject: [PATCH] Revert to 'f' formatting for floats in line protocol Using 'g' with -1 precision switches over to scientific notation for too small of numbers, and setting a larger precision results in larger than desired representations. --- plugins/serializers/influx/influx.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/serializers/influx/influx.go b/plugins/serializers/influx/influx.go index 51aed0d09..59d7662aa 100644 --- a/plugins/serializers/influx/influx.go +++ b/plugins/serializers/influx/influx.go @@ -262,7 +262,7 @@ func appendIntField(buf []byte, value int64) []byte { } func appendFloatField(buf []byte, value float64) []byte { - return strconv.AppendFloat(buf, value, 'g', -1, 64) + return strconv.AppendFloat(buf, value, 'f', -1, 64) } func appendBoolField(buf []byte, value bool) []byte {