MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / toDouble

Function toDouble

lib/config/proto.cc:36–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36static double toDouble(const std::string& value)
37{
38 try
39 {
40 size_t idx;
41 double d = std::stod(value, &idx);
42 if (value[idx] != '\0')
43 throw std::invalid_argument("trailing garbage");
44 return d;
45 }
46 catch (const std::invalid_argument& e)
47 {
48 error("invalid number '{}'", value);
49 }
50}
51
52static int64_t toInt64(const std::string& value)
53{

Callers 1

setMethod · 0.85

Calls 1

errorFunction · 0.85

Tested by

no test coverage detected