Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: 5_Dragonfly_Cayenne_Sprint_IKS01A1
Fork of Cayenne-MQTT-mbed-MTSAS by
Diff: src/CayenneUtils/CayenneDataArray.h
- Revision:
- 15:1f4d5dbf1928
- Parent:
- 8:aec9cfdd4c8e
- Child:
- 23:1a9aed5e77c9
--- a/src/CayenneUtils/CayenneDataArray.h Tue Nov 01 15:48:52 2016 -0600
+++ b/src/CayenneUtils/CayenneDataArray.h Fri Nov 04 13:25:27 2016 -0600
@@ -289,7 +289,11 @@
*/
inline void add(const __FlashStringHelper* unit, const float value) {
char str[33];
+#if defined(__AVR__) || defined (ARDUINO_ARCH_ARC32)
dtostrf(value, 5, 3, str);
+#else
+ snprintf(str, 33, "%2.3f", value);
+#endif
add(unit, str);
}
@@ -300,7 +304,11 @@
*/
inline void add(const __FlashStringHelper* unit, const double value) {
char str[33];
+#if defined(__AVR__) || defined (ARDUINO_ARCH_ARC32)
dtostrf(value, 5, 3, str);
+#else
+ snprintf(str, 33, "%2.3f", value);
+#endif
add(unit, str);
}
