bool Adafruit_IO_Feed::send(double value) { // Convert double to string using scientific notation, then send the value // (being careful not to quote it). memset(_converted, 0, sizeof(_converted)); #if defined(ARDUINO_ARCH_AVR) // Use avrlibc dtostre function on AVR platforms. dtostre(value, _converted, 10, 0); #else // Otherwise fall back to snprintf on other platforms. snprintf(_converted, sizeof(_converted)-1, "%f", value); #endif return _adapter->send(_name, _converted, _key, false); }
void print_fp(float number) { char s[10]; dtostre(number,s,3,0); print_string(s); }