MCPcopy Create free account
hub / github.com/ElementsProject/elements / ParseDouble

Function ParseDouble

src/univalue/lib/univalue_get.cpp:62–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62bool ParseDouble(const std::string& str, double *out)
63{
64 if (!ParsePrechecks(str))
65 return false;
66 if (str.size() >= 2 && str[0] == '0' && str[1] == 'x') // No hexadecimal floats allowed
67 return false;
68 std::istringstream text(str);
69 text.imbue(std::locale::classic());
70 double result;
71 text >> result;
72 if(out) *out = result;
73 return text.eof() && !text.fail();
74}
75}
76
77const std::vector<std::string>& UniValue::getKeys() const

Callers 1

get_realMethod · 0.85

Calls 3

ParsePrechecksFunction · 0.85
sizeMethod · 0.45
eofMethod · 0.45

Tested by

no test coverage detected