From cb38dba9fe0344b02f4b183152263fe3c0066290 Mon Sep 17 00:00:00 2001
From: Iztok Jeras <iztok.jeras@redpitaya.com>
Date: 摹曛, 08 10月 2015 03:00:34 +0800
Subject: [PATCH] integer parse: added support for float

---
 libscpi/inc/scpi/config.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/libscpi/inc/scpi/config.h b/libscpi/inc/scpi/config.h
index 0ee0454..c3f4e7e 100644
--- a/libscpi/inc/scpi/config.h
+++ b/libscpi/inc/scpi/config.h
@@ -166,6 +166,12 @@
 #endif
 
 #if HAVE_DTOSTRE
+#define SCPIDEFINE_floatToStr(v, s, l) strlen(dtostre((double)(v), (s), 6, DTOSTR_PLUS_SIGN | DTOSTR_ALWAYS_SIGN | DTOSTR_UPPERCASE))
+#else
+#define SCPIDEFINE_floatToStr(v, s, l) snprintf((s), (l), "%g", (v))
+#endif
+
+#if HAVE_DTOSTRE
 #define SCPIDEFINE_doubleToStr(v, s, l) strlen(dtostre((v), (s), 6, DTOSTR_PLUS_SIGN | DTOSTR_ALWAYS_SIGN | DTOSTR_UPPERCASE))
 #else
 #define SCPIDEFINE_doubleToStr(v, s, l) snprintf((s), (l), "%lg", (v))

--
Gitblit v1.9.1