File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -829,17 +829,24 @@ void String::trim(void) {
829829// /*********************************************/
830830
831831long String::toInt (void ) const {
832- if (buffer ())
832+ if (buffer ())
833833 return atol (buffer ());
834834 return 0 ;
835835}
836836
837837float String::toFloat (void ) const {
838- if (buffer ())
838+ if (buffer ())
839839 return atof (buffer ());
840840 return 0 ;
841841}
842842
843+ double String::toDouble (void ) const
844+ {
845+ if (buffer ())
846+ return atof (buffer ());
847+ return 0.0 ;
848+ }
849+
843850// global empty string to allow returning const String& with nothing
844851
845852const String emptyString;
Original file line number Diff line number Diff line change @@ -241,6 +241,7 @@ class String {
241241 // parsing/conversion
242242 long toInt (void ) const ;
243243 float toFloat (void ) const ;
244+ double toDouble (void ) const ;
244245
245246 protected:
246247 // Contains the string info when we're not in SSO mode
You can’t perform that action at this time.
0 commit comments