src/third_party/icu/source/i18n/units_converter.cpp
// TODO: Make this a shared-utility function.
// Returns `double` from a scientific number(i.e. "1", "2.01" or "3.09E+4")
Make this a shared-utility function.
Returns `double` from a scientific number
Make this a shared - utility function . Returns ` double ` from a scientific number
double strToDouble(StringPiece strNum, UErrorCode &status) {
    StringToDoubleConverter converter(0, 0, 0, "", "");
    int32_t count;
    double result = converter.StringToDouble(strNum.data(), strNum.length(), &count);
    if (count != strNum.length()) {
        status = U_INVALID_FORMAT_ERROR;
    }
    return result;
}
double strToDouble ( StringPiece strNum , UErrorCode & status ) { StringToDoubleConverter converter ( 0 , 0 , 0 , " " , " " ) ; int32_t count ; double result = converter . StringToDouble ( strNum . data ( ) , strNum . length ( ) , & count ) ; if ( count != strNum . length ( ) ) { status = U_INVALID_FORMAT_ERROR ; } return result ; }
TODO: Make this a shared-utility function.
TODO : Make this a shared - utility function .
// We are processing well-formed input, so we don't need any special options to // StringToDoubleConverter.