MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / stringToDouble

Function stringToDouble

src/utilities/filetypes/EpwFile.cpp:1661–1672  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1659}
1660
1661static double stringToDouble(const std::string& string, bool* ok) {
1662 double value = 0;
1663 *ok = true;
1664 try {
1665 value = std::stod(string);
1666 } catch (const std::invalid_argument&) {
1667 *ok = false;
1668 } catch (const std::out_of_range&) {
1669 *ok = false;
1670 }
1671 return value;
1672}
1673
1674Date EpwDataPoint::date() const {
1675 return {MonthOfYear(m_month), static_cast<unsigned int>(m_day), m_year};

Calls

no outgoing calls

Tested by

no test coverage detected