mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-29 07:32:18 +03:00
Исправляем валидацию базового параметра округления
This commit is contained in:
@@ -43,7 +43,7 @@ String IoTItem::getID() {
|
|||||||
|
|
||||||
String IoTItem::getValue() {
|
String IoTItem::getValue() {
|
||||||
if (value.isDecimal)
|
if (value.isDecimal)
|
||||||
if (_round >= 0) {
|
if (_round >= 0 && _round <= 6) {
|
||||||
char buf[15];
|
char buf[15];
|
||||||
sprintf(buf, ("%1." + (String)_round + "f").c_str(), value.valD);
|
sprintf(buf, ("%1." + (String)_round + "f").c_str(), value.valD);
|
||||||
return (String)buf;
|
return (String)buf;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
"plus": 0,
|
"plus": 0,
|
||||||
"multiply": 1,
|
"multiply": 1,
|
||||||
"round": 100,
|
"round": 2,
|
||||||
"int": 10
|
"int": 10
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
Reference in New Issue
Block a user