diff --git a/src/lib/ebus/datatype.cpp b/src/lib/ebus/datatype.cpp index 399cc6fd..59b5cab2 100755 --- a/src/lib/ebus/datatype.cpp +++ b/src/lib/ebus/datatype.cpp @@ -696,6 +696,14 @@ result_t NumberDataType::readSymbols(size_t offset, size_t length, const SymbolS } } #endif + if (isnan(val)) { + if (outputFormat & OF_JSON) { + *output << "null"; + } else { + *output << nullptr_VALUE; + } + return RESULT_OK; + } if (val != 0.0) { if (m_divisor < 0) { val *= static_cast(-m_divisor); diff --git a/src/lib/ebus/test/test_data.cpp b/src/lib/ebus/test/test_data.cpp index c9373c4c..3ca8fd9a 100755 --- a/src/lib/ebus/test/test_data.cpp +++ b/src/lib/ebus/test/test_data.cpp @@ -412,6 +412,7 @@ int main() { {"x,,exp", "-32.767", "10feffff04681103c2", "00", ""}, {"x,,exp,1000", "-0.000090000", "10feffff04ec51b8bd", "00", ""}, {"x,,exp,-100", "-9", "10feffff04ec51b8bd", "00", ""}, + {"x,,exp", "-", "10feffff040000c07f", "00", "W"}, {"x,,exr", "-0.09", "10feffff04bdb851ec", "00", ""}, {"x,,exr", "0.0", "10feffff0400000000", "00", ""}, {"x,,exr", "-0.001", "10feffff04ba83126f", "00", ""},