From 4bda1a51404fc652cf3ad86c3a87ef8894dc554f Mon Sep 17 00:00:00 2001 From: John Date: Sun, 16 Jan 2022 20:00:39 +0100 Subject: [PATCH] potential fix for truncated float representation --- src/lib/ebus/datatype.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/ebus/datatype.cpp b/src/lib/ebus/datatype.cpp index 187bc129..23e58727 100755 --- a/src/lib/ebus/datatype.cpp +++ b/src/lib/ebus/datatype.cpp @@ -34,6 +34,7 @@ namespace ebusd { using std::dec; +using std::defaultfloat; using std::hex; using std::fixed; using std::setfill; @@ -731,7 +732,7 @@ result_t NumberDataType::readSymbols(size_t offset, size_t length, const SymbolS if (result != RESULT_OK) { return result; } - *output << setw(0) << dec; // initialize output + *output << defaultfloat << setw(0) << dec; // initialize output if (!hasFlag(REQ) && value == m_replacement) { if (outputFormat & OF_JSON) {