diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp index 4129984..9f2145a 100644 --- a/src/lib_json/json_writer.cpp +++ b/src/lib_json/json_writer.cpp @@ -51,9 +51,9 @@ std::string valueToString( double value ) { char buffer[32]; #ifdef __STDC_SECURE_LIB__ // Use secure version with visual studio 2005 to avoid warning. - sprintf_s(buffer, sizeof(buffer), "%.16g", value); + sprintf_s(buffer, sizeof(buffer), "%#.16g", value); #else - sprintf(buffer, "%.16g", value); + sprintf(buffer, "%#.16g", value); #endif char* ch = buffer + strlen(buffer) - 1; if (*ch != '0') return buffer; // nothing to truncate, so save time