mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-02 00:38:26 +01:00
Serialize floats in objects
This commit is contained in:
@@ -19,10 +19,15 @@ void JsonValue::operator=(char const* value)
|
||||
}
|
||||
|
||||
void JsonValue::operator=(double value)
|
||||
{
|
||||
set(value, 2);
|
||||
}
|
||||
|
||||
void JsonValue::set(double value, int decimals)
|
||||
{
|
||||
if (!_node) return;
|
||||
|
||||
_node->type = JSON_DOUBLE_2_DECIMALS;
|
||||
_node->type = (JsonNodeType) (JSON_DOUBLE_0_DECIMALS + decimals);
|
||||
_node->content.asDouble = value;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user