MT#59962 AmUtils: add string to double conversion

Add support for floating types.

Change-Id: I75ee2ff1a6f545a7a3cd2f27014029ca9880d207
mr14.1
Donat Zenichev 8 months ago
parent 1609823c1a
commit d69d4961fa

@ -284,6 +284,12 @@ bool str2int(const string& str, int& result)
return str2int(s,result);
}
bool str2int(const string& str, double& result)
{
char* s = (char*)str.c_str();
return atof(s);
}
bool str2int(char*& str, int& result, char sep)
{
int ret=0;

@ -148,6 +148,8 @@ bool str2int(char*& str, unsigned int& result, char sep = ' ');
*/
bool str2int(const string& str, int& result);
bool str2int(const string& str, double& result);
/**
* Internal version of preceeding 'str2int' method.
* @param str [in,out] gets incremented until sep char or error occurs

Loading…
Cancel
Save