File tree 2 files changed +10
-2
lines changed
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) {
829
829
// /*********************************************/
830
830
831
831
long String::toInt (void ) const {
832
- if (buffer ())
832
+ if (buffer ())
833
833
return atol (buffer ());
834
834
return 0 ;
835
835
}
836
836
837
837
float String::toFloat (void ) const {
838
- if (buffer ())
838
+ if (buffer ())
839
839
return atof (buffer ());
840
840
return 0 ;
841
841
}
842
842
843
+ double String::toDouble (void ) const
844
+ {
845
+ if (buffer ())
846
+ return atof (buffer ());
847
+ return 0.0 ;
848
+ }
849
+
843
850
// global empty string to allow returning const String& with nothing
844
851
845
852
const String emptyString;
Original file line number Diff line number Diff line change @@ -241,6 +241,7 @@ class String {
241
241
// parsing/conversion
242
242
long toInt (void ) const ;
243
243
float toFloat (void ) const ;
244
+ double toDouble (void ) const ;
244
245
245
246
protected:
246
247
// Contains the string info when we're not in SSO mode
You can’t perform that action at this time.
0 commit comments