From b84a781dd744704edf832b25d90510cdaeb72305 Mon Sep 17 00:00:00 2001 From: Andreas Berg Date: Wed, 1 Nov 2023 18:08:09 +0200 Subject: [PATCH] Write all numbers as floats --- nodes/InfluxDb/influxdb.node.utils.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/nodes/InfluxDb/influxdb.node.utils.ts b/nodes/InfluxDb/influxdb.node.utils.ts index f92d7be..a3f7d25 100644 --- a/nodes/InfluxDb/influxdb.node.utils.ts +++ b/nodes/InfluxDb/influxdb.node.utils.ts @@ -48,13 +48,9 @@ export async function writeData(client: InfluxDB, data: [], org: string, bucket: break; } case 'number': { - if (Number.isInteger(dataItem[field])) { // int - point = point.intField(field, dataItem[field] as number); - break; - } else { // float - point = point.floatField(field, dataItem[field] as number); - break; - } + // write all numbers as floats, see https://github.com/influxdata/influxdb/issues/3460#issuecomment-124747104 + point = point.floatField(field, dataItem[field] as number); + break; } case 'string': { point = point.stringField(field, dataItem[field] as string);