ArduinoJson 5.10.0 * Removed configurable number of decimal places (issues #288, #427 and #506) * Changed exponentation thresholds to `1e7` and `1e-5` (issues #288, #427 and #506) * `JsonVariant::is<double>()` now returns `true` for integers * Fixed error `IsBaseOf is not a member of ArduinoJson::TypeTraits` (issue #495) * Fixed error `forming reference to reference` (issue #495)
Changes since 5.9.0
- Removed configurable number of decimal places (issues #288, #427 and #506)
- Changed exponentation thresholds to
1e7and1e-5(issues #288, #427 and #506) -
JsonVariant::is<double>()now returnstruefor integers - Fixed error
IsBaseOf is not a member of ArduinoJson::TypeTraits(issue #495) - Fixed error
forming reference to reference(issue #495)
BREAKING CHANGES ⚠
| Old syntax | New syntax |
|---|---|
double_with_n_digits(3.14, 2) |
3.14 |
float_with_n_digits(3.14, 2) |
3.14f |
obj.set("key", 3.14, 2) |
obj["key"] = 3.14 |
arr.add(3.14, 2) |
arr.add(3.14) |
| Input | Old output | New output |
|---|---|---|
3.14159 |
3.14 |
3.14159 |
42.0 |
42.00 |
42 |
0.0 |
0.00 |
0 |
| Expression | Old result | New result |
|---|---|---|
JsonVariant(42).is<int>() |
true |
true |
JsonVariant(42).is<float>() |
false |
true |
JsonVariant(42).is<double>() |
false |
true |
How to install
There are several ways to install ArduinoJson, from simpler to more complex:
- Use the Arduino Library Manager
- Download
ArduinoJson-v5.10.0.hbelow and put it in your project folder - Download
ArduinoJson-v5.10.0.zipand extract it in youlibrariesfolder
Note: ArduinoJson-v5.10.0.h are ArduinoJson-v5.10.0.hpp are almost identical; the difference is that the .hpp keeps everything in the ArduinoJson namespace.