MCPcopy Create free account
hub / github.com/NatLabRockies/SAM / VarValueDoubleToJSONValue

Function VarValueDoubleToJSONValue

src/variables.cpp:1519–1542  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1517
1518
1519rapidjson::Value VarValueDoubleToJSONValue(const double& d)
1520{
1521 rapidjson::Value json_val;
1522 //json_val.SetDouble(d);
1523 //json_val = d;
1524 json_val.SetDouble(d);
1525 /*
1526 if (std::isnan(d))
1527 json_val = "nan";
1528 else if (std::isinf(d))
1529 json_val = "inf";
1530 else {
1531 float f = static_cast<float>(d);
1532 if (std::isinf(f)) { // SAM issue 1189
1533 json_val = d;
1534 }
1535 else {
1536 wxString s = wxString::Format("%g", f);
1537 json_val = wxAtof(s);
1538 }
1539 }
1540 */
1541 return json_val;
1542}
1543
1544
1545void VarValue::Write_JSON(rapidjson::Document& doc, const wxString& name, const wxArrayString& asCalculated, const wxArrayString& asIndicator)

Callers 2

Write_JSONMethod · 0.85
Write_JSON_ConstantMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected