Closed pnt325 closed 3 months ago
@pnt325 Can you please explain the exact purpose of this code change.
@pnt325 Can you please explain the exact purpose of this code change.
I use round2 to limit the number of character for double value on JSON. Example value = 12.3456789
add to json it's look like
{
"value": 123.456789
}
after round
{
"value": 123.46
}
It's reduce the data size of JSON. From current code it's just round correct for negative value https://github.com/airgradienthq/arduino/blob/e46e11c03066a4aba3706b90f9184582c1c94178/src/AirGradient.cpp#L45-L46
if the input value is negative the round value is not correct. This update to correct round negative value like I'm mention to link on description.
Update round 2 decimal digit value on JSON support negative value