MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / ParseDouble

Function ParseDouble

src/utilstrencodings.cpp:461–473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

459}
460
461bool ParseDouble(const std::string& str, double *out)
462{
463 if (!ParsePrechecks(str))
464 return false;
465 if (str.size() >= 2 && str[0] == '0' && str[1] == 'x') // No hexadecimal floats allowed
466 return false;
467 std::istringstream text(str);
468 text.imbue(std::locale::classic());
469 double result;
470 text >> result;
471 if(out) *out = result;
472 return text.eof() && !text.fail();
473}
474
475std::string FormatParagraph(const std::string in, size_t width, size_t indent)
476{

Callers 2

BOOST_AUTO_TEST_CASEFunction · 0.85
get_realMethod · 0.85

Calls 3

ParsePrechecksFunction · 0.85
sizeMethod · 0.45
eofMethod · 0.45

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.68