Commit b74a02cb authored by Iván Pérez's avatar Iván Pérez

WString: add `toDouble`

`toFloat` internally converts into double and then truncates into a
float, so why not add a method to return the double?
parent 0f959829
......@@ -740,6 +740,11 @@ long String::toInt(void) const
float String::toFloat(void) const
{
if (buffer) return float(atof(buffer));
return 0;
return float(toDouble());
}
double String::toDouble(void) const
{
if (buffer) return atof(buffer);
return 0;
}
\ No newline at end of file
......@@ -190,6 +190,7 @@ public:
// parsing/conversion
long toInt(void) const;
float toFloat(void) const;
double toDouble(void) const;
protected:
char *buffer; // the actual char array
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment