From c658343e7fed5f074f4ee4c302fdd4fd97b7eba2 Mon Sep 17 00:00:00 2001 From: biver Date: Tue, 26 Apr 2022 23:03:00 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D1=8F=D0=B5=D0=BC=20=D0=B2=D0=B0=D0=BB=D0=B8=D0=B4=D0=B0=D1=86?= =?UTF-8?q?=D0=B8=D1=8E=20=D0=B1=D0=B0=D0=B7=D0=BE=D0=B2=D0=BE=D0=B3=D0=BE?= =?UTF-8?q?=20=D0=BF=D0=B0=D1=80=D0=B0=D0=BC=D0=B5=D1=82=D1=80=D0=B0=20?= =?UTF-8?q?=D0=BE=D0=BA=D1=80=D1=83=D0=B3=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/classes/IoTItem.cpp | 2 +- src/modules/sensors/Ads1115/items.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/classes/IoTItem.cpp b/src/classes/IoTItem.cpp index 429392d0..95349149 100644 --- a/src/classes/IoTItem.cpp +++ b/src/classes/IoTItem.cpp @@ -43,7 +43,7 @@ String IoTItem::getID() { String IoTItem::getValue() { if (value.isDecimal) - if (_round >= 0) { + if (_round >= 0 && _round <= 6) { char buf[15]; sprintf(buf, ("%1." + (String)_round + "f").c_str(), value.valD); return (String)buf; diff --git a/src/modules/sensors/Ads1115/items.json b/src/modules/sensors/Ads1115/items.json index 9cfc0bcd..af458b77 100644 --- a/src/modules/sensors/Ads1115/items.json +++ b/src/modules/sensors/Ads1115/items.json @@ -15,7 +15,7 @@ "plus": 0, "multiply": 1, - "round": 100, + "round": 2, "int": 10 } ] \ No newline at end of file