mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-23 07:17:30 +02: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