| 1517 | |
| 1518 | |
| 1519 | rapidjson::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 | |
| 1545 | void VarValue::Write_JSON(rapidjson::Document& doc, const wxString& name, const wxArrayString& asCalculated, const wxArrayString& asIndicator) |
no outgoing calls
no test coverage detected