mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2003 Move conversion from string to double into RiaStdStringTools
This commit is contained in:
@@ -54,3 +54,16 @@ int RiaStdStringTools::toInt(const std::string& s)
|
||||
|
||||
return intValue;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RiaStdStringTools::toDouble(const std::string& s)
|
||||
{
|
||||
double doubleValue = -1.0;
|
||||
|
||||
char* end;
|
||||
doubleValue = std::strtod(s.data(), &end);
|
||||
|
||||
return doubleValue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user