We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
toDouble
1 parent e6f81fd commit 2c26660Copy full SHA for 2c26660
hardware/arduino/avr/cores/arduino/WString.cpp
@@ -740,6 +740,11 @@ long String::toInt(void) const
740
741
float String::toFloat(void) const
742
{
743
- if (buffer) return float(atof(buffer));
744
- return 0;
+ return float(toDouble());
745
}
+
746
+double String::toDouble(void) const
747
+{
748
+ if (buffer) return atof(buffer);
749
+ return 0;
750
+}
hardware/arduino/avr/cores/arduino/WString.h
@@ -190,6 +190,7 @@ class String
190
// parsing/conversion
191
long toInt(void) const;
192
float toFloat(void) const;
193
+ double toDouble(void) const;
194
195
protected:
196
char *buffer; // the actual char array
0 commit comments