From cc60ed9df0ac6193e3a6ae2ee03b982a51db5788 Mon Sep 17 00:00:00 2001 From: Nico Stuurman Date: Wed, 16 Oct 2024 15:10:22 -0700 Subject: [PATCH] Utilities: better way to fix conundrum of 3.3 versus 3.30 --- DeviceAdapters/Utilities/DATTLStateDevice.cpp | 5 +++-- DeviceAdapters/Utilities/Utilities.cpp | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/DeviceAdapters/Utilities/DATTLStateDevice.cpp b/DeviceAdapters/Utilities/DATTLStateDevice.cpp index f07077639..a6f7e5020 100644 --- a/DeviceAdapters/Utilities/DATTLStateDevice.cpp +++ b/DeviceAdapters/Utilities/DATTLStateDevice.cpp @@ -391,8 +391,9 @@ int DATTLStateDevice::OnTTLLevel(MM::PropertyBase* pProp, MM::ActionType eAct) { if (eAct == MM::BeforeGet) { - - pProp->Set(CDeviceUtils::ConvertToString(ttlVoltage_)); + char buffer[8]; + snprintf(buffer, sizeof(buffer), "%.1f", ttlVoltage_); + pProp->Set(buffer); } else if (eAct == MM::AfterSet) { diff --git a/DeviceAdapters/Utilities/Utilities.cpp b/DeviceAdapters/Utilities/Utilities.cpp index eb1259f3c..66698521f 100644 --- a/DeviceAdapters/Utilities/Utilities.cpp +++ b/DeviceAdapters/Utilities/Utilities.cpp @@ -65,8 +65,8 @@ const char* g_normalLogicString = "Normal"; const char* g_invertedLogicString = "Inverted"; const char* g_InvertLogic = "Invert Logic"; const char* g_TTLVoltage = "TTL Voltage"; -const char* g_3_3 = "3.30"; -const char* g_5_0 = "5.00"; +const char* g_3_3 = "3.3"; +const char* g_5_0 = "5.0";