Added ARDUINOJSON_ENABLE_NAN to enable NaN in JSON (closes #973)

This commit is contained in:
Benoit Blanchon
2019-05-18 12:15:36 +02:00
parent 90c1d549a8
commit 7427888e05
8 changed files with 72 additions and 4 deletions

View File

@@ -52,7 +52,7 @@ class TextFormatter {
template <typename T>
void writeFloat(T value) {
if (isnan(value)) return writeRaw("NaN");
if (isnan(value)) return writeRaw(ARDUINOJSON_ENABLE_NAN ? "NaN" : "null");
if (value < 0.0) {
writeRaw('-');