diff --git a/lib/json.cpp b/lib/json.cpp index c7ea0ca0..e4175ebc 100644 --- a/lib/json.cpp +++ b/lib/json.cpp @@ -1196,7 +1196,8 @@ std::string JSON::Value::toString() const { } case DOUBLE: { std::stringstream st; - st << dblVal; + st.precision(10); + st << std::fixed << dblVal; return st.str(); break; } @@ -1260,10 +1261,19 @@ std::string JSON::Value::toPrettyString(int indentation) const { } case DOUBLE: { std::stringstream st; - st << dblVal; + st.precision(10); + st << std::fixed << dblVal; return st.str(); break; } + case BOOL: { + if (intVal != 0){ + return "true"; + }else{ + return "false"; + } + break; + } case STRING: { for (unsigned int i = 0; i < 201 && i < strVal.size(); ++i) { if (strVal[i] < 32 || strVal[i] > 126 || strVal.size() > 200) {